Ruby Characters to ASCII
This piece of code converts Ruby Characters to ASCII code and vice versa.
This piece of code converts Ruby Characters to ASCII code and vice versa.
These are different ways to divide or slice ruby string. All of these statements gives the same output.
This is a simple example that shows how ruby string successor works.
The following piece of code validates any email that ends with .com, .edu, .org or any three letter extension. It uses regular expressions to find a match.
In my last post, i gave a simple snippet to reverse ruby string. Here, I am giving simple snippet to reverse ruby string words. So, given string like “ruby on rails”, the output going to be “rails on ruby”.
This how we reverse entire string in ruby :
To reverse ruby string words, check this link.
The following sample of code capitalizes the first character of every word in a string.
And you can do the ruby string capitalization in this way (from David Felstead)