From: duc nguyen Date: 2011-03-04T11:16:32+09:00 Subject: Re: How can i get the first letter of this string thanks for all! I tried all instructions above and they work fine when i run from command line. But when i insert them to my .rb file in my project and debug, An error has happen, and i don't know why "á is the first letter" =~ /^(.)(.*)/u puts "-->#{$1}<--" puts "-->#{$2}<--" --output in command prompt window:-- -->á<-- --> is the first letter<-- But in the log file of my project I 03/04/2011 09:07:39:169 b0353000 APP| -->√<-- I 03/04/2011 09:07:39:169 b0353000 APP| -->° is the first letter<-- Again, i change the code: "á is the first letter" =~ /^(..)(.*)/u puts "-->#{$1}<--" puts "-->#{$2}<--" And now it works. I 03/04/2011 09:11:03:414 b03d5000 APP| -->á<-- I 03/04/2011 09:11:03:414 b03d5000 APP| --> is the first letter<-- My project is a rhodes project. Rhodes version 2.2.6. Ruby 1.8.7. -- Posted via http://www.ruby-forum.com/.