12345678910111213141516171819202122 |
- (def testStr "this is my \n test str")
- // split on newline
- (assert (==
- "this is my " (first
- (split testStr "\n"))))
- // second index
- (assert (==
- " test str" (aget
- (split testStr "\n") 1)))
- // split on space
- (assert (==
- 6 (len
- (split testStr " "))))
- // don't split on char that doesn't exist
- (assert (==
- 1 (len
- (split testStr "."))))
|