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

Remove ALL Punctuation

Status
Not open for further replies.

DaveyDSmith

Programmer
Mar 21, 2008
19
How do I remove ALL punctuation from a field? I can take out commas and replace them with a space by using REPLACE (InputString, "," , " "). Fields have multiple punctuations including , . # ' " >> (writing in CR v2008)
 
There's a UFL for this that I found here...


Scroll down to ....

UFL to strip Punctuation from a string, by Paul Birch at maginus.com

I just tested it and it works with CRXI 11



-- Jason
"It's Just Ones and Zeros
 
Thanks Jason, Not sure if this will work for me, because I am using Crystal for Peachtree. I got a tip from a friend on LinkedIn and it involves building a variable. It worked for me. Thanks for your response. Dave

whileprintingrecords;
local stringvar myText := {table.field};

myText := REPLACE(myText,",","");
myText := REPLACE(myText,".","");
myText := REPLACE(myText,"'",""); // I always forget the exact string here, it may be four " or try '"' (double single double)
myText := REPLACE(myText,""",""); // I always forget the exact string here, it may be four " or try '"' (single double single)
myText := REPLACE(myText,"/","");
myText := REPLACE(myText,"?","");

myText
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top