I'm very new to ruby, in fact I just read it today. But I need to do something quick in Ruby, suppose I have a string ABC=180000. What I want to do is remove the last two chars and makes it become 8 chars of string, so the above case result should be 00001800
in case the string ABC=AA000, the final result is 00000AA0
Could you guys tell me how to do this quickly?
Thanks a lot!