words


Description:

public static string[] words (string? s)

Split the string by whitespace and return non-empty tokens. Equivalent to Go's strings.Fields.

Example:

    string[] result = Strings.words ("  hello   world  ");
assert (result.length == 2);
assert (result[0] == "hello");

Parameters:

s

the string.

Returns:

array of words.