ClipLeft(string,int) and ClipRight(string,int)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

ClipLeft(string,int) and ClipRight(string,int)

Post by DoubleDutch »

This would really be handy:

string$=ClipLeft(string$,int=1) would cut 'int' characters from the left of string$

Effectively:

Code: Select all

string$=Right(string$,len(string$)-int)
string$=ClipRight(string$,int=1) would cut 'int' characters from the right of string$

Effectively:

Code: Select all

string$=Left(string$,len(string$)-int)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: ClipLeft(string,int) and ClipRight(string,int)

Post by Little John »

DoubleDutch wrote:This would really be handy:

string$=ClipLeft(string$,int=1) would cut 'int' characters from the left of string$

Effectively:

Code: Select all

string$=Right(string$,len(string$)-int)
Or

Code: Select all

string$ = Mid(string$, int+1)
:)

Regards, Little John
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: ClipLeft(string,int) and ClipRight(string,int)

Post by DoubleDutch »

Yep, I just had the ClipLeft because of ClipRight. ;)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply