Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 419

"startswith" and "endswith" operators

$
0
0

ColdFusion has a contains operator, as in:

if ( value contains "foo" ) { ... }

To be fair, I almost never use this; but, I do like the sematics of it. Seems strange that we don’t have a startswith and endswith operator as well. As in:

if ( value endsWith "@bennadel.com" ) { ... }
if ( value startsWith "http://" ) { ... }

I know that the underlying java.lang.String implementation has these corresponding methods. So, it seems like it would be rather trivial to expose them as operators ?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 419

Trending Articles