Robert Klemme
7/3/2006 9:58:00 AM
Josselin wrote:
> On 2006-07-03 09:26:31 +0200, Robert Klemme <bob.news@gmx.net> said:
>
>> Josselin wrote:
>>> running fine, but had no time actually to look into the code (soccer
>>> world cup, France-Brasil !)
>>
>> :-) Congrats! Now there's only old and new Europe left in the cup...
>> At the moment I consider the French to be favorite but I keep my
>> fingers crossed for the Germans of course.
>>
>> Kind regards
>>
>> robert
>
> Even if the French team is more 'experienced' I still consider Germany
> has the favorite beacuse playing home (as the French in 98..) and more
> I'd like the Germans get the same feeling we got in 98... they deserve
> it ! I consider this cup as beautiful as 98 because of the Germans
> people behavior... Germany-France will be my favorite final !!!
>
> as you have a lot of Ruby knowledge , I would like to 'exchange'
> dot-commas in a string
>
> s= "123.456,78" -> "123,456.78"
> I now I should use a s.gsub with a block, but I don't know actually
> how to write it... (I can write 3 gsubs.... but it would be ugly.....)
>> "123.456,78".gsub(/[.,]/) {|m| m == "." ? "," : "."}
=> "123,456.78"
But his is far better:
>> "123.456,78".tr ".,", ",."
=> "123,456.78"
Cheers
robert