Template:Needs Translation/
函数名
|
Function: string llDeleteSubString( string src, integer start, integer end );
|
参数:
- string src
- integer start – start index
- integer end - end index
|
返回值:Returns a string that is the result of removing characters from src from start to end.
|
注意事项
|
*If either start or end are out of bounds the script continues to execute without an error message.
- start & end will form an exclusion range when start is past end (Approximately: start > end).
|
示例
|
示例1
default
{
state_entry()
{
string ex = "abcdefghi";
llDeleteSubString(ex, 4, 7); //Incorrect!
}
}
示例2
default
{
state_entry()
{
string ex = "abcdefghi";
ex = llDeleteSubString(ex, 4, 7); //Correct
llSay(0, ex); //Would say "abcdi"
}
}
示例3(特例)
//-- special case
default
{
state_entry()
{
string ex = "abcdefghi";
llSay( 0, llDeleteSubString(ex, 4, 7) ); //Would say "abcdi"
//-- acceptable if you do NOT want to change the contents of 'ex', only the output
}
}
|