views:

322

answers:

2

I have a string:

string cover = "withaname"

I would like to change the withaname to withnoname.

I would then like to change withnoname to withanamegoose.

What is the best way to accomplish this in LSL?

+2  A: 

If you have a special character that will separate your data, you can use functions such as llList2String.

llGetSubString Is probably what you are actually looking for. I really dont understand your exact question though.

string The_String = "withaname";
integer i = llSubStringIndex(The_String, "a");
The_String = llInsertString(llDeleteSubString(The_String, i, i), i, "no");
llSay(0, The_String);
// says "withnoname"
NULL
is there another way without replace or add?to change the complete withaname, not with llInsertString.can i go and use The_String?it would be better if i get the name "inanführungszeichen" ,may from another event.i need an answer in common for this.thanks
OK if I am understanding you, then your are just asking how to replace a variables value. string name = "aaaaa"; //name is aaaaa name = "bbbbb"; //name is bbbbb llSay(0, name); //Will say "bbbbb"However I find it hard to believe that you are really asking how to set the value of a string. So if not, I am sorry that this is not helpful. I really would like to help you, but I honestly do not understand what you are asking.
NULL
A: 

i try to give these the names "aaaaa" or "bbbbb" not with parse or insert or something like this.

Perhaps you should give another example of code, and tell us what you want it to result in. The only ways you can manipulate strings in lsl is to explicitly set them, parse them to lists, and use the llInsertString functions. There is no other way to manipulate a string. If you want to append a string to another string you just use +.Example: string a = "b" + "c"; // a = "bc"
NULL