Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to strip out trailing blanks/CR/LFs from a stri
Message
From
19/07/2004 12:59:58
 
 
To
19/07/2004 12:43:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00925773
Message ID:
00925827
Views:
19
* Alan Popow

t1= Seconds ()

For I = 1 To 100000
    Do While Right (cSourceString, 1) $ (" " + Chr (13) + Chr (10))
       cSourceString = Left (cSourceString, Len (cSourceString) -1)
    EndDo
EndFor

Elap4 = Seconds () - t1

* Mike Pratt 

t1= Seconds ()

For I = 1 To 100000
    Do While InList (Right (cSourceString, 1), Chr (32), Chr (10), Chr (13))
	   cSourceString = Left (cSourceString, Len (cSourceString) - 1)
    EndDo
EndFor

Elap5 = Seconds () - t1

Attention, with this code you do only one true computation.

Use a temporary var:
* Alan Popow

t1= Seconds ()

For I = 1 To 100000
    crem=cSourceString
    Do While Right (crem, 1) $ (" " + Chr (13) + Chr (10))
       crem = Left (crem, Len (crem) -1)
    EndDo
EndFor

Elap4 = Seconds () - t1

* Mike Pratt 

t1= Seconds ()

For I = 1 To 100000
    crem=cSourceString
    Do While InList (Right (crem, 1), Chr (32), Chr (10), Chr (13))
	   crem = Left (crem, Len (crem) - 1)
    EndDo
EndFor

Elap5 = Seconds () - t1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform