04-16-2009 4:43 PM
Hi all,
There are some string like these ;
aaa-bbb--ccc
aabbbb---cc
aaaabbccc
.....
how can replace - or -- or ---or -
or -
with one space? Could you send me the algorithm?
Best regards,
Munur
04-16-2009 4:50 PM
Hi Munur ,
you can use the command Replace all occurrences of.
let ur string be str = 'aabb-cc--'.
REPLACE ALL OCCURRENCES of '-' in str with space.
This can solve ur problem.
Regards,
Anuj
04-16-2009 5:03 PM
use statement
Replace all occurence of '-' in <your field> with space.
If the above single statement gives you too many spaces use the following lines.
Replace all occurence of '----' in <your field> with space.
Replace all occurence of '---' in <your field> with space.
Replace all occurence of '--' in <your field> with space.
Replace all occurence of '-' in <your field> with space.
This will definitely serve your purpose.
Regards,
Lalit Mohan Gupta.
04-16-2009 5:16 PM
Hi.
Use:
REPLACE ALL OCCURRENCES OF '-' IN str WITH SPACE.
and later, if you wish just ONE space,
CONDENSE str.
04-16-2009 5:37 PM
Hi,
You can use regular expressions for that:
REPLACE ALL OCCURRENCES OF REGEX '-*' IN <your_string> WITH <replacement>.
This will replace caracters '-', '', '-', etc. in you string by the replacement string you specified.
Hope it helps.
Regards,
Tanguy
04-16-2009 5:52 PM