Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert and replace value in the string in one shot?

Status
Not open for further replies.

thelearner

Programmer
Jan 10, 2004
153
US
Hi,

<Cell ss:StyleID="s26"><Data ss:Type="String">&&*01</Data></Cell>

In the string above, I want to replace &&*01 with some data. Currently this is how I do this.

Temp = %REPLACE('':SourceString:I:5); // remove &&*01
Result= %REPLACE(MyData:Temp:I:0); //Insert data

( 'I' is the position that I found &&*)

Can I achieve the same result with one %REPLACE or any one operation code or buildin fxn?

Thank in advance.


 
SourceString="<Cell ss:StyleID="s26"><Data ss:Type="String">&&*01</Data></Cell>";

Result = %replace(SomeData:SourceString:%scan('&&*01': SourceString): 5);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top