string.popLeading

Syntax string.popLeading (string, character)

Params string is the string of characters from which you wish to remove certain leading characters.

character is the leading character you wish to remove.

Action Deletes all leading occurrences of character from string.

Returns The resulting string.

Examples string.popLeading ("*****$33.33", '*')

   » "$33.33"

string.popLeading ("###34.23#", '#')

   » "34.23#"

Note that it leaves the ending pound sign in place; only leading characters are removed.

string.popLeading ("No leading characters here!", '#')

   » "No leading characters here!"

No leading characters found, so the string is returned unchanged.

Notes Be sure character is a single character enclosed in single or double quotation marks.

See Also string.filledString

Discuss