Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
i have string and i need to delete the ' and the "
exemple:
'aklasdfj'dasdf ->aklasdfjdasdf
(without ')
"a"das"df ->adasdf
(without ")
how can i do it?
Try This ways
LOAD *,KeepChar(StringChar,'abcdefghijklmnopqrstuvwxyz') as NewChar;
LOAD * Inline
[
StringChar
'aklasdfj'dasdf
"a"das"df
];
Regards
Anand
Purgechar(MyString, '''"')
That's an opening single quote, then two single quotes so the first escapes the second, then a double quote and finally a closing single quote.
Or this:
PurgeChar(Fieldname, Chr(39)) as NewFieldName
UPDATE:
for both single and double quotes, you can try this:
PurgeChar(Fieldname, Chr(34)&Chr(39)) as NewFieldName
load
field,
PurgeChar(field, chr(39)&chr(34)) as newfield
inline [
field
'aklasdfj'dasdf
(without ')
"a"das"df
];
That's probably a better solution. Easier to read and understand than all those quotes.
Hi Adi,
I will use PurgeChar() function.
PurgeChar(YourString, YourCharToRemove)
Quote and Double Quote = chr(39) and chr(34)
See complete Ascii table: http://www.asciitable.com/
Best
Maurice