Text_File_Handler module

break_by_spaces

procedure · 1 overloadSource

Splits line after its first word: the word, and the rest with the spaces before it removed. Both point into line. A line of one word gives an empty rest.

break_by_spaces :: (line: string) -> (left: string, right: string)

Parameters

line: string

Returns

left: string
right: string
ExampleOpen in playground ↗
word, rest := break_by_spaces("  set  volume 11 ");
assert(word == "set" && rest == "volume 11");

See also