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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNSTRING the string text with a delimit character

Status
Not open for further replies.

Yukii007

MIS
Jan 14, 2003
1
CA
I am try to unstring the text from a single string.
For example, "A/USA/CANADA/UK" would like to split
as A, USA, CANADA and UK
 
If you have CR8 or higher the follwing formula will give what you have described above. It will be limited to 254 characters in CR8 and 8.5, but can be larger in CR9 (i'm not sure of the exact length limit, if one exists)

stringvar array splt:=split("A/USA/CANADA/UK","/");//change this to the field in your table
numbervar loopT:=ubound(splt);
numbervar loop;
stringvar hold;
stringvar output;

for loop:=1 to loopT do(

if loop=loopT then hold:= " and "& splt[loop]
else hold:=splt[loop] &", ";
output:=output+hold);

output
Mike
If you're not part of the solution, you're part of the precipitate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top