UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | String Verbs > string.replaceAll

string.replaceAll

Syntax string.replaceAll (s, searchfor, replacewith, flCaseSensitive = true)

Params s is the string in which the replacement should occur.

searchfor is the string of characters to be replaced.

replacewith is the string of characters to replace searchfor.

flCaseSensitive is an optional boolean determining whether the search should be case-sensitive. Default: True.

Action Locates every occurrence of searchfor in s and replaces each of them with replacewith.

Returns The resulting string. If searchfor is not found in string, then s is returned unchanged.

Examples string.replaceAll ("6:46:25 PM", ":", "-")

   » "6-46-25 PM"

string.replaceAll ("abcdefghijklm", "xxx", "12345")

   » "abcdefghijklm" // "xxx" not found, so string is unchanged.

See Also string.replace

string.multipleReplaceAll

Prev | Next | String Verbs > string.replaceAll

Anonymization by Anonymouse.org ~ Adverts
Anonymouse better ad-free, faster and with encryption?
X