Talk:LlGetSubString

From Second Life Wiki
Jump to navigation Jump to search

What should be mentioned is if "start" starts at 0 or at 1.

(Same for llDeleteSubString and llInsertString!)

Start starts at index (integer) 0 -- Eddy (talk|contribs) 11:20, 8 June 2009 (UTC)

You will find an explanation of indexes in the Specification section and again in the Notes. The text is housed in the Template:LSL_Function/negative index, if you choose to edit it, be sure to make it work for both lists and strings. -- Strife (talk|contribs) 19:01, 8 June 2009 (UTC)

I wonder if anyone can explain this ----> llGetSubString() returns a string. If that string is expressed via another function for example llSay() the result is as you would expect (substring "A" : say "A"). However if the substring is used within the script to make reference to another string or key etc. it fails. The evidence being that if "A" is typed into the script in place of llGetSubString() where substring would return "A" and the "A" in question is the name of a string or key to be used the result is correct. If llGetSubString() is used to gather the "A" up the string or key that is called "A" is not referenced.

I believe this has something to do with UTF-8 or something but I cannot figure out how to get around it. Could a brainbox of lsl contribute on this point? -- Eddy (talk|contribs) 11:20, 8 June 2009 (UTC)

I doubt it has anything to do with UTF-8. I'm having trouble figuring out what you mean. Say you have a variable named "my_str" that is of type string. Say my_str has the value "ABC". Say we use llGetSubString to get a substring of my_str so that the return is "A". Say we store that result into my_other_str. Are you trying to say that if we change the value of my_str, my_other_str isn't updated? I'm sorry, LSL isn't Lambda Calculus. -- Strife (talk|contribs) 19:01, 8 June 2009 (UTC)