UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

string.replaceAll

Previous topic: Next topic:
inactiveTopic string.replaceAll topic started 6/19/1999; 5:32:00 PM
last post 6/19/1999; 5:32:00 PM
user Brent Simmons - string.replaceAll  blueArrow
6/19/1999; 5:32:00 PM (reads: 47335, responses: 0)
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


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