Sergey Berezniker 1: VFP9 rTrim(): 0.218 Sergey Berezniker 2: VFP9 rTrim(): 0.219But you didn't answer my question "BTW, looking at VFP9's help file I couldn't find that syntax you've presented. How did you get to it?". Could you?
cRem = = RTRIM(cSourceString, SPACE(1), CHR(10), CHR(13))>
>>cTempSource= " Test of " + chr(13) + Chr (10) + ; >> " char removal " + chr(13) + Chr (10) + ; >> chr(13) + Chr (10) + ; >> Space ( 5) + chr(13) + Chr (10) + ; >> Space (10) >> >>* Sergey Berezniker 1: VFP9 rTrim() >> >>cSourceString = cTempSource >> >>t1= Seconds () >> >>For I = 1 To 100000 >> cRem = RTRIM(cSourceString,0, SPACE(1), CHR(10), CHR(13)) >>EndFor >> >>Elap8 = Seconds () - t1 >> >>* Sergey Berezniker 2: VFP9 rTrim() >> >>cSourceString = cTempSource >> >>t1= Seconds () >> >>For I = 1 To 100000 >> cRem = = RTRIM(cSourceString, SPACE(1), CHR(10), CHR(13)) >>EndFor >> >>Elap9 = Seconds () - t1 >> >>MessageBox ("Sergey Berezniker 1: VFP9 rTrim(): " + Transform (Elap8) + Chr (13) + Chr (10) + ; >> "Sergey Berezniker 2: VFP9 rTrim(): " + Transform (Elap9) ) >>>>After 100,000 loops for each routine I got the following results:
>>Sergey Berezniker 1: VFP9 rTrim(): 0.219 >>Sergey Berezniker 2: VFP9 rTrim(): Error: Command contains unrecognized phrase/keyword. >>>>So the final score for all tests are:
>>Gregory Adam (StripTrailing): 0.875 >>Gregory Adam (StripTrailing2): 0.187 >>Fabio Lunardon: 0.203 >>Alan Popow: 3.938 >>Mike Pratt: 3.953 >>Steve Gibson: 2.015 >>Sergey Berezniker 1: VFP9 rTrim(): 0.219 >>Sergey Berezniker 2: VFP9 rTrim(): Error: Command contains unrecognized>>
>>>cString = RTRIM(cString,0, SPACE(1), CHR(10), CHR(13)) >>>* or >>>cString = RTRIM(cString, SPACE(1), CHR(10), CHR(13)) >>>>>>
>>>>cString = "This is what I want to keep!" + ; >>>> Space (10) + Chr (13) + Chr (10) + Chr (13) + Chr (10) + ; >>>> Space ( 1) + Chr (13) + Chr (10) + ; >>>> Space ( 1) >>>>>>>>After execution of the routine, all trailing blanks/CR/LFs should be removed (last 18 characters removed, first 28 characters ketp).