Archive for ruby Strings

Ruby Characters to ASCII

This piece of code converts Ruby Characters to ASCII code and vice versa.


Comments

Slice Ruby String

These are different ways to divide or slice ruby string. All of these statements gives the same output.


Comments

Ruby String successor

This is a simple example that shows how ruby string successor works.


Comments

Email validation using ruby

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.


Comments (5)

Reverse Ruby String Words

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”.

Comments (3)

Reverse Ruby String

This how we reverse entire string in ruby :

To reverse ruby string words, check this link.

Comments

Capitalize the first character of multi word string

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)

Comments (7)