Page 1 of 1

EndsWith and StartsWith

Posted: Sun Mar 18, 2018 12:13 pm
by djrikki

Code: Select all

bool = EndsWith(s$, substr$[, casesen, encoding])
This function can be used to check if s$ ends on the substring specified by substr$. If it does, True is returned, False otherwise. If the optional argument casesen is set to False, the strings do not have to match in case.
The optional encoding parameter can be used to set the character encoding to use. This defaults to the default string encoding set using SetDefaultEncoding(). See Character encodings for details.
In my experience the first two arguments are the opposite way around:

Code: Select all

bool = EndsWith(haystack$, needle$[, casesen, encoding])

Re: EndsWith and StartsWith

Posted: Tue Mar 20, 2018 7:36 pm
by airsoftsoftwair
Huh? It says the "function can be used to check if s$ ends on the substring specified by substr$" so s$ is the haystack and substr$ is the needle. So where is the problem?