This is nothing new or shocking, but I thought I’d post it anyway.  When you’re dealing with ColdFusion content, you have available a number of exposed Java string methods that can be used in addition to the functions that CF provides.  You don’t have to invoke any Java objects or nonsense like that–simply call the method and see what happens.

Of course, many from the full list of Java string methods are either already familiar via CF functions or can be replicated quite easily by CF-only functions.  Nonetheless, I thought I’d share a quick roundup of what I think are some of the more interesting, along with simple examples of how to use them.  I hope you enjoy this Bleach-inspired sampling 🙂

Method Code Result charat
value = 'Bleach is awesome';
3 concat
value = 'Bleach is awesome';
addtl = ' because of the epic battle sequences';
Bleach is awesome because of the epic battle sequences contains
value = 'Ichigo Kurosaki';
Yes endswith (case sensitive)
value = 'Zanpakutou';
Yes lastindexof
value = 'You can catch new episodes of Bleach on,
but only if you have a membership for which you pay each month';
101 split
value = 'Shinigami|Bount|Hollow';
[Shinigami,Bount,Hollow] startswith (case sensitive) More >