Question about String Manipulation

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
Yocal
GamingTools Subscriber
Posts: 20
Joined: Mon Jan 17, 2005 11:25 am

Question about String Manipulation

Post by Yocal » Mon Oct 17, 2005 7:31 am

Heya,

I've search through the wiki, but havent been able to locate an answer to my problem. Therefore, i ask here.

If i have a string: "Translucent Horse of Substitution" and i want to replace "Translucent " with "", what is the easiest way to do so?

Thanks!

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Mon Oct 17, 2005 11:55 am

The answer for this one would be found here http://www.lavishsoft.com/wiki/index.ph ... ype:string

For substring substitution, there's no real easy answer. Single-character replacement is done fast by using a replacement table, but I cant do the same for substring. What you might want to do is use string.Find[substring]. If the word you're removing is always the first one, you can do something like echo ${MyString.Right[-${MyString.Find["Translucent "]}]}

Post Reply