Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Remove a Single quote in a String

Hi All,

I have a requirement to do a Wildmatch on the string 'Reg'is' ,but as the string has a single quote after the letter g,its not taking the field value,have used Purgechar() function but unable to remove the single quote.

Please help me out on the function to be used.

Thanks,

Neha

1 Solution

Accepted Solutions
Not applicable
Author

In that case you can do something like if(Name='Reg'&Chr(39)&'is','Regis',Name)

You can do this in a list box expression or in the backend. This will replace

Reg'is with Regis

View solution in original post

11 Replies
maxgro
MVP
MVP

this seems to work

load replace(col1, chr(39), '');

LOAD * INLINE [

col1Reg'is

aa''aa''aa

];

Clipboard01.jpg

rustyfishbones
Master II
Master II

Try REPLACE

REPLACE(YourField,CHR(39),'') as NewField

See the attached file

Not applicable
Author

While loading the data from source, remove the single quote with Replace function.

LOAD Replace(FieldName , chr(39) ,'') AS FieldName

.

.

.

;

SELECT * FROM TABLENAME ;

Not applicable
Author

Hey Neha,

Use

PurgeChar(Name,Chr(39)) as NewVAlue.

Here Chr(39) will give you '

Attached is a sample

Thanks

AJ

Not applicable
Author

Instead of Pulling it as a new value,can't we do it on the front end,cause I need to remove the single quote only from this single String value 'Reg'is'

Thanks,

Neha

santharubban
Creator III
Creator III

YOU CAN TRY THIS

load PurgeChar(col1, '');

LOAD * INLINE [

col1Reg'is

aa'aa'aa

];

maxgro
MVP
MVP

in listbox use an expression

=replace(col1, chr(39), '')

in chart a calculated dimension (=replace(col1, chr(39), ''))

Not applicable
Author

In that case you can do something like if(Name='Reg'&Chr(39)&'is','Regis',Name)

You can do this in a list box expression or in the backend. This will replace

Reg'is with Regis

rustyfishbones
Master II
Master II

Yes you can use the same as a List Box Expression

REPLACE(YourField,CHR(39),'')