hcl-bot
December 5, 2005, 11:05am
1
I have an agent that exports field data from the documents in a view. One of the fields contains a lot of symbols representing feet and inches (single and double quotes). This causes a problem because the export encloses each field in double-quotes.
Does anyone know how to write something similar to @ReplaceSubstring in LotusScript?
hcl-bot
December 5, 2005, 11:13am
2
Subject: @ReplaceSubstring in LotusScript?
Hi there,
You could use something like this to replace “X” for “Y”
While Instr(Yourstring, “X”)>0
Yourstring = Strleft(Yourstring, "X") & "Y" & Strright(Yourstring,"X")
Wend
Hope this helps,
Craig.
hcl-bot
December 5, 2005, 11:12am
3
Subject: @ReplaceSubstring in LotusScript?
Take a look at the Replace function in Designer Help.
Subject: RE: @ReplaceSubstring in LotusScript?
Thanks for your response Stan,
The example in HELP is using arrays. Do you have an example of using REPLACE to replace characters in a field with different charcaters?
Again, in a single field, my users enter ’ and " to represent feet and inches.
Specifically, I need LS to change:
a double-quote followed by a space to INCHES
and
a single-quote followed by a space to FEET
Both of these are in the same field.
Thanks!
Subject: RE: @ReplaceSubstring in LotusScript?
The example may be an array, but you don’t need it to be; a single string is just a one-element array:
Replace(myStartingString, “'”, “FEET”)
Replace(myStartingString, “'”", “INCHES”) (not sure about the escaping of double-quotes here)