[Implemented] Trim(), LTrim() and RTrim()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

[Implemented] Trim(), LTrim() and RTrim()

Post by Psychophanta »

Should be very useful if these functions allow an optional parameter to tell what char to trim (not only spaces).
Result$ = Trim(String$ [, Character$])
Result$ = LTrim(String$ [, Character$])
Result$ = RTrim(String$ [, Character$]) :)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

Yes, and take that idea one step further, please: let this extra parameter be of type array[], so that it can contain characters (plural) to trim. Also, in this case one could imagine predefined arrays, for instance one that contains all whitespace chars, one that contains all ASCII control sequences, one that..... etc.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Thats a good idea...except that you can't pass arrays
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Sure you can. You just pass the array pointer, nothing to it.
filperj
User
User
Posts: 77
Joined: Tue Sep 16, 2003 8:53 pm
Location: Nevers(France)

Post by filperj »

And a string is an array of characters.

Code: Select all

 Result$ = Trim(String$ [, "The characters I want to remove"])
Post Reply