De-quote a String

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

De-quote a String

Post by yaminids »

Hello there,

Is there a way to de-quote a string. My intension is to remove the quotes from a input string.
Thanx in advance.

-Yamini
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Provided that there are no "quoted quote characters", you can simply use Convert() function.

Code: Select all

Convert('"', '', TheQuotedString)
Another technique is to remove the first and final characters using a substring technique.

Code: Select all

TheQuotedString[2,Len(TheQuotedString)-2]
You may need to trim off leading and trailing white space first. Use TrimF() and TrimB() functions, or Trim() with "B" as the third argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

De-quote a String

Post by yaminids »

Hello Ray,
Thank you for your suggestion.
-Yamini
Post Reply