OsStringReplace
From OpenSimulator
(Difference between revisions)
(Created page with "{{osslfunc |permissions=true |threat_level= |function_syntax=integer osStringIndexOf(string src, string value, integer ignoreCase) |ossl_example=<source lang = "lsl"> // Examp...") |
|||
(2 intermediate revisions by one user not shown) | |||
Line 2: | Line 2: | ||
|permissions=true | |permissions=true | ||
|threat_level= | |threat_level= | ||
− | |function_syntax= | + | |function_syntax=string osStringReplace(string src, string oldvalue, string newvalue) |
|ossl_example=<source lang = "lsl"> | |ossl_example=<source lang = "lsl"> | ||
// Example of osStringRemove | // Example of osStringRemove | ||
Line 10: | Line 10: | ||
state_entry() | state_entry() | ||
{ | { | ||
− | llSay(PUBLIC_CHANNEL, "Touch me to show | + | llSay(PUBLIC_CHANNEL, "Touch me to show osStringReplace"); |
} | } | ||
touch_start(integer n) | touch_start(integer n) | ||
{ | { | ||
− | string src = " | + | string src = "abcdefdedhdekef"; |
− | string val = " | + | string val = "de"; |
− | llOwnerSay((string) | + | string nval = ""; |
+ | llOwnerSay((string)osStringReplace(src, val, nval)); | ||
} | } | ||
} | } | ||
</source> | </source> | ||
− | |description= | + | |description= Returns a string in which all occurrences of the string oldvalue in string src are replaced by string newvalue |
| | | | ||
}} | }} |
Latest revision as of 17:02, 1 May 2019
string osStringReplace(string src, string oldvalue, string newvalue)
| |
Returns a string in which all occurrences of the string oldvalue in string src are replaced by string newvalue | |
Threat Level | No threat level specified |
Permissions | Use of this function is always allowed by default |
Extra Delay | No function delay specified |
Example(s) | |
// Example of osStringRemove default { state_entry() { llSay(PUBLIC_CHANNEL, "Touch me to show osStringReplace"); } touch_start(integer n) { string src = "abcdefdedhdekef"; string val = "de"; string nval = ""; llOwnerSay((string)osStringReplace(src, val, nval)); } } |