Page 1 of 1

replace multiple positions values in a string--Server job

Posted: Wed Oct 31, 2007 3:16 pm
by srinivenigalla
Suppose Value is "0 0 0 0 0 0 0 0 0 0 0 0
position 1 2 3 4 5 6 7 8 9 10 11 12

A. first position to be checked for '0' AND IF IT IS '0' (replace FIRST position with 'k'
B. and (then 2nd 3rd 4th positins ar replaced with a value of a column which is a 3 character value).

I want to understand what is the best way of doing this. Can i use stage variables for deriving the conditions seperatel and use those stage variables in columns or is their any other better way to do it.

2. what is the function or method to be used to replace all the 3 characters with a field value as you see question B is to replace.

Please suggest.

Posted: Wed Oct 31, 2007 4:49 pm
by ArndW
WorkString = "Hello World"
WorkString[3,3] = "123"

Now WorkString is "He123 World"