Skip to main content
Topic: cut n characters from the begining of a string (Read 246 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

cut n characters from the begining of a string

A quick question :

Is there an easier way to trim n characters of a string on its left side - easier than this:
Quote
$substr(string,n,$len(string))
Isn't there an a way to signify the end of a string like "-1" or $substr(string, n ,-1)

Re: cut n characters from the begining of a string

Reply #1
$left(X,Y)  or $right(X,Y)  depending what you want.

Re: cut n characters from the begining of a string

Reply #2
These functions leave the length of a string you specify and trims the rest . I want the opposite: a function which trims a string by removing the specified amount of letters.

It is not difficult to achieve with a sub-function in two steps solution but I thought perhaps there's a better way.

Re: cut n characters from the begining of a string

Reply #3
$substr(string,n,9999) is almost always ok.

 

 
SimplePortal 1.0.0 RC1 © 2008-2018