duc nguyen wrote in post #985120:
> thanks for your  help!
> My strings are in UTF-8 encoding. Ruby version 1.8.7
>
> I just follow your instructions and got the first letter of that string.
> But i still not get the remainder of string after get the first letter.>

# encoding:utf-8

" is the first letter" =~ /^(.)(.*)/u

puts "-->#{$1}<--"
puts "-->#{$2}<--"

--output:--
--><--
--> is the first letter<--


> My problem now is convert the UTF-8 string to ansi string.
> ex: purpose: change "" to "aeoiu".
> I really confuse and don't have any way to do that.
>


# encoding:utf-8


" is the first letter" =~ /^(.)(.*)/u

conversion_hash = {
   '' => 'a',
   '' => 'e',
   '' => 'o',
   '' => 'i',
   '' => 'u'
}

puts "#{conversion_hash[$1]}#{$2}"

--output:--
a is the first letter