Ruby Split String Into Array

It will remove nothing at all from the original string and split on every character.
Ruby split string into array. This would be done for example if you have a string like foo bar baz and you want the three strings foo bar and baz the split method of the string class can accomplish this for you. String objects in ruby have a method called split it is similar to the split function of perl it can cut up a string into pieces along a pre defined string or regex returning an array of smaller strings. Yeah i know this but once i convert split string then i want to add another string into it and then want convert into array using join user557657 feb 2 11 at 2 47 1 you should provide example of what you want to do. Values line split parse each number in the result array.
If the delimiter passed to string split is a zero length string or regular expression then string split will act a bit differently. I used scan instead of split to make a small improvement in this rubymonk module lesson second code from the bottom of the page. One of the most basic string manipulation actions is to split a string into multiple sub strings.