Difference between revisions of "LlStringTrim"

From Second Life Wiki
Jump to: navigation, search
Line 18: Line 18:
 
{{!}}-
 
{{!}}-
 
{{!}}[[STRING_TRIM_HEAD]]
 
{{!}}[[STRING_TRIM_HEAD]]
{{!}}0x01
+
{{!}}{{LSL Hex|0x01|}}
 
{{!}}Trims spaces off the beginning.
 
{{!}}Trims spaces off the beginning.
 
{{!}}-
 
{{!}}-
 
{{!}}[[STRING_TRIM_TAIL]]
 
{{!}}[[STRING_TRIM_TAIL]]
{{!}}0x02
+
{{!}}{{LSL Hex|0x02|}}
 
{{!}}Trims spaces off the end
 
{{!}}Trims spaces off the end
 
{{!}}-
 
{{!}}-
 
{{!}}[[STRING_TRIM]]
 
{{!}}[[STRING_TRIM]]
{{!}}0x03
+
{{!}}{{LSL Hex|0x03|}}
 
{{!}}Trims spaces off the beginning and end.
 
{{!}}Trims spaces off the beginning and end.
 
{{!}}}
 
{{!}}}
Line 41: Line 41:
 
string src = "  Dah    ";
 
string src = "  Dah    ";
 
st = llStringTrim(src, STRING_TRIM_HEAD);
 
st = llStringTrim(src, STRING_TRIM_HEAD);
st = llStringTrim(src, STRING_TRIM_TAIL);
+
st = llStringTrim(st , STRING_TRIM_TAIL);
 
</pre>
 
</pre>
 
<pre>
 
<pre>

Revision as of 01:13, 9 April 2007

  Note! Preview Documentation

This only exists on the preview grid

Summary

Function: string llStringTrim( string src, integer type );

Returns a string that is src with leading and/or trailing spaces trimmed from it.

• string src
• integer type STRING_TRIM* flag(s)
Constant Description
STRING_TRIM_HEAD 0x01 Trims spaces off the beginning.
STRING_TRIM_TAIL 0x02 Trims spaces off the end
STRING_TRIM 0x03 Trims spaces off the beginning and end.

Examples

Notes

This function is available in 1.13.4 onwards...

The following examples will make the same result.

string src = "   Dah    ";
st = llStringTrim(src, STRING_TRIM_HEAD);
st = llStringTrim(st , STRING_TRIM_TAIL);
string src = "   Dah    ";
st = llStringTrim(src, STRING_TRIM);

This is because (STRING_TRIM_HEAD | STRING_TRIM_TAIL) == STRING_TRIM.

Deep Notes

Search JIRA for related Issues

Signature

function string llStringTrim( string src, integer type );