Difference between revisions of "LlInsertString"

From Second Life Wiki
Jump to navigation Jump to search
(Links to Examples corrected)
(Parameter description clarified)
Line 1: Line 1:
{{LSL_Function/negative_index|false|position}}{{LSL_Function
{{LSL_Function/negative_index|false|position}}{{LSL_Function|func_id=96|func_sleep=0.0|func_energy=10.0
|func_id=96|func_sleep=0.0|func_energy=10.0
|func=llInsertString|return_type=string
|func=llInsertString|return_type=string
|p1_type=string|p1_name=dst
|p1_type=string|p1_name=dst|p1_desc=destination of insertion
|p2_type=integer|p2_name=position
|p2_type=integer|p2_name=pos|p2_desc=position index for insert, first is 0
|p3_type=string|p3_name=src
|p3_type=string|p3_name=src|p3_desc=source string to be inserted
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text='''dst''' with '''src''' inserted starting at '''position'''.
|return_text='''dst''' with '''src''' inserted starting at '''pos'''.
|spec
|spec
|caveats
|caveats

Revision as of 02:30, 8 October 2007

Summary

Function: string llInsertString( string dst, integer pos, string src );
0.0 Forced Delay
10.0 Energy

Returns a string dst with src inserted starting at pos.

• string dst destination of insertion
• integer pos position index for insert, first is 0
• string src source string to be inserted

position does not support negative indexes.

Caveats

  • If position is out of bounds the script continues to execute without an error message.

Examples

llInsertString("input", 2, "put out")// returns "input output"

See Also

Functions

•  llDeleteSubString
•  llGetSubString

Articles

•  Examples: str_replace Replace all instances of a string with another string in a target string
•  Examples: SplitLine Insert 'new line' escape codes at certain positions of a string

Deep Notes

Signature

function string llInsertString( string dst, integer pos, string src );