mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
Added example to .split (#18736)
This commit is contained in:
parent
d4f97b7081
commit
4f6fb22e7f
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user