Added example to .split (#18736)

This commit is contained in:
Shafrazi
2018-10-16 01:15:21 +05:30
committed by Quincy Larson
parent d4f97b7081
commit 4f6fb22e7f

View File

@ -90,7 +90,11 @@ _Note that the first letter is only capitalized if it is at the beginning of the
```ruby
"H-e-l-l-o".split('-') #=> ["H", "e", "l", "l", "o"]
```
* To split a word in to individual letters :
``` ruby
"hello".split("") #=> ["h", "e", "l", "l", "o"]
```
### Chop:
* The `.chop` method removes the last character of the string.