Replace In A String

Ask questions about how to create a script or swap scripts with other users.
Post Reply
User avatar
micha_he
Posts: 570
Joined: 24 Jul 2011 12:16
Location: Helmstedt, NDS, Germany

Replace In A String

Post by micha_he »

I have a String like "(abcdef)" in the selection. I would like replace the "(" with an empty string with a scriptpart like this:

Code: Select all

MoveStr = Document.SelText;
ShowMessage(MoveStr);
MoveStr = ScriptUtils.WStringReplaceAll(MoveStr, "(", "");
ShowMessage(MoveStr);
But nothing is replaced. Why ? Who is it correct ?
User avatar
pjj
Posts: 2109
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Replace In A String

Post by pjj »

Seems like it doesn't want to use empty string as a replacement at all. No idea how to circumvent it, though.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
Post Reply