Page 1 of 5

String Manipulation

Posted: Mon Jun 06, 2005 12:04 am
by billthecat
I'm looking for a good way to filter certain characters out of a given string. Suppose I start out with a string:

"frag men d'ary a`la word"

What's the best way of filtering it down to:

"fragmendaryalaword"

I figured I could clean it up in 3 passes by looking for 1 of the 3 characters I'm removing and picking out the string segments that happen between what I'm looking to remove with a command like string.token[1,'], and then just concatenating them together.

That seems kinda ugly though. I was not able to find any string methods in the docs to do this and so far searching the boards hasn't shown anything either. Any other methods I've missed?

Posted: Mon Jun 06, 2005 1:41 am
by dont_know_at_all

Posted: Mon Jun 06, 2005 4:49 pm
by billthecat
Okaaaay, maybe I should rephrase that.

The methods listed in that section of the docs are the ones that allowed me to concoct the manner of filtering I already have. I'm using the Length, Right, and Arg/Token methods to pull the string apart into chunks that I have to append back together again.

A filter method would just nuke the characters I want to remove, and close the gaps.

Is there a way to use regular expressions in a script?

Posted: Mon Jun 06, 2005 5:03 pm
by dont_know_at_all
No.

There is a perl plugin floating around. I'm not sure if it works.

Otherwise, you could write your own plugin to do what you want.

Re: String Manipulation

Posted: Fri May 23, 2025 11:25 pm
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:02 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:39 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:40 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:41 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:42 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:43 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:44 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:46 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:47 am
by xyilla

Re: String Manipulation

Posted: Sat May 24, 2025 12:48 am
by xyilla