Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Quick question about a string

Alberrt Steptoe
Second Life Resident
Join date: 31 Oct 2004
Posts: 19
02-19-2009 14:44
Hello,

Something really bothering me and just cant think of the best or easiest way to do it but the promblem I have is as follows.

I have a string of say 172 characters but I need to replace say every 20th character with a *.

What would be the best way to do it?

Any help would be real great.

Thank you.

- Alberrt
Lennard Lopez
Registered User
Join date: 9 Oct 2007
Posts: 52
02-19-2009 15:34
This should do it

CODE

integer i;
string org="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
string result;

for (i=0; i<llStingLength(org);i=i+20)
result=result+llgetSubstring(original,i,i+19) + "x";
Alberrt Steptoe
Second Life Resident
Join date: 31 Oct 2004
Posts: 19
02-19-2009 16:24
That worked brilliantly

Thank you, not sure why I couldn't see that before but Thanks again.

- Alberrt