Page 1 of 1
Trim() error if there's "-"
Posted: 16 Mar 2014 13:14
by binocular222
Code: Select all
echo trim("D:\folder-1", "folder-1")
Untitled20140316191401.png
Re: Trim() error if there's "-"
Posted: 17 Mar 2014 15:05
by admin
User error: the argument is supposed to be a list of characters, not a multi-character string.
Re: Trim() error if there's "-"
Posted: 18 Mar 2014 01:31
by PeterH
admin wrote:User error: the argument is supposed to be a list of characters, not a multi-character string.
Isn't it (also

) a list of characters?
Re: Trim() error if there's "-"
Posted: 18 Mar 2014 07:29
by admin
Re: Trim() error if there's "-"
Posted: 18 Mar 2014 12:08
by PeterH
It seems that's not explicitely the syntax Trim is using? (Maybe just the part for "list"?)
But a guess:
- in a list "-" should specify a range, and r-1 is an invalid range specification?
- or shold the range be specified separated from the list, i.e. "folde","r-1"? (I don't believe, as it looks like 2 operands. But you have an example for "ranges" saying
"a-m", "3-6". Might be a bit misleading?)
And OK: all this doesn't seem to be what binocular222 wanted...
Re: Trim() error if there's "-"
Posted: 18 Mar 2014 12:46
by binocular222
I'm fine, there're workarounds
I should have used strpos() and substr()