<cfwhat>

Tuesday, December 22, 2009

Using Java methods in ColdFusion

Because ColdFusion variables map to Java objects it is possible to use Java methods directly on the ColdFusion variables. The methods available depend on the underlying Java data type.

Example:
<cfset string1 = "untitled">
<cfset string2 = string1.substring(2, 7)> produces "title"

Here are some links to the documentation.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/package-tree.html

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html

0 Comments:

Post a Comment

<< Home