Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: cut n characters from the begining of a string (Read 1468 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.