LlDeleteSubString

来自人工智能助力教育知识百科
Qmf讨论 | 贡献2020年4月13日 (一) 09:08的版本 (创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: string llDeleteSubString( string src, integer start, integ…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

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
    }
}
相关函数
llGetSubString

llInsertString llDeleteSubList

相关事件