Difference between revisions of "Category:LSL String"
Jump to navigation
Jump to search
(merge String into Category:LSL_String, redirect String to Category:LSL_String) |
|||
Line 5: | Line 5: | ||
String examples: | String examples: | ||
<pre>"Hello Avatar!", "Yes", "No", "It's 10 o'clock.", "I am 21 years old!"</pre> | <pre>"Hello Avatar!", "Yes", "No", "It's 10 o'clock.", "I am 21 years old!"</pre> | ||
{{Box|Useful Functions|<pre> | |||
string TrimRight(string src, string chrs) | |||
{ | |||
integer i = llStringLength(src); | |||
do;while(~llSubStringIndex(chrs, llGetSubString(src, i = ~ -i, i)) && i); | |||
return llDeleteSubString(src, -~i, 0xFFFF); | |||
} | |||
string TrimLeft(string src, string chrs) | |||
{ | |||
integer i = ~llStringLength(src); | |||
do;while(i && ~llSubStringIndex(chrs, llGetSubString(src, (i = -~i), i))); | |||
return llDeleteSubString(src, 0xFFFF0000, ~-i); | |||
} | |||
</pre>}} |
Revision as of 14:46, 11 March 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
A string is a text data. String values are enclosed in quotes when you define them. You can use every letter or number in a string!
String examples:
"Hello Avatar!", "Yes", "No", "It's 10 o'clock.", "I am 21 years old!"
Useful Functions
string TrimRight(string src, string chrs) { integer i = llStringLength(src); do;while(~llSubStringIndex(chrs, llGetSubString(src, i = ~ -i, i)) && i); return llDeleteSubString(src, -~i, 0xFFFF); } string TrimLeft(string src, string chrs) { integer i = ~llStringLength(src); do;while(i && ~llSubStringIndex(chrs, llGetSubString(src, (i = -~i), i))); return llDeleteSubString(src, 0xFFFF0000, ~-i); }
Subcategories
This category has the following 2 subcategories, out of 2 total.
Pages in category "LSL String"
The following 46 pages are in this category, out of 46 total.