>I have this question if it is possible to trim a string on a specific character and replace it with blank value?
>example: I have 3 set of strings '0000001230023', '00045698000988', '002134'
>what I want is to scan on these strings and replace the zeros with '' until it reaches the nonzero value. The first string containing 6 zeros from left until it reaches the no 1 should be replace with '' the rest will remain in the string.
Hi Mike,
sure it is possible. Though I am not sure, if it could be done in VFP within one expression. Looks like you have to build a UDF with a loop, or - more elegant - use regular expressions:
loRegExp = CREATEOBJECT('VBScript.RegExp')
loRegExp.Global = .F.
loRegExp.Pattern = '^0+'
? loRegExp.Replace('00045698000988','')
HTH Robert
I've acquired quite a taste for a well-made mistake... [Fiona Apple]