Returns an array consisting of the words in the string

string:split_to_words(STRING $string) : ARRAY

string:split_to_words('good  day')
#=> [ "good", "day" ]



# note: this function removes extra white-space characters
string:split_to_words("good   bad \n\t ugly")
#=> [ "good", "bad", "ugly" ]

# note: anything separated by space is considered a word
string:split_to_words("user_name? test..good @#$ funny")
#=> [ "user_name?", "test..good", "@#\$", "funny" ]

Copyright ©2013-2022 SunSed®. All rights reserved.