My Account   Contact Us    
  
» HomeProductsSupportDeveloper CommunityCompany
String Object java.lang.String

Some useful methods
Return Type Method Signiture Description
String string.substring(int position) returns the substring starting at position, zero based
String string.substring(int position, int length) returns the substring length characters long starting at position, zero based
int string.indexOf(string substring) returns a zero based index to of where substring occurrs in string
int string.indexOf(string substring, int startPosition) returns a zero based index to of where substring occurrs in string starting at startPosition
boolean string.startsWith(String substring) true if the string starts with substring
boolean string.endsWith(String substring) true if the string ends with substring
char string.charAt(int pos) returns the character at a specified position

See java.lang.String documentation for more methods. Note that the java.lang.String class has changed in Java 1.4 so if your running a 1.3 JVM you won't be able to do some of the regular expression functions.

Examples
<cfset str = "hello">
<cfoutput>
str.substring(0,2) = #str.substring(0,2)# = he
str.indexOf("el") = #str.indexOf("el")# = 1
str.startsWith("he") = #str.startsWith("he")# = true </cfoutput>


ColdFusion MX Un-Documentation
Sign up for our newsletter: | Subscribe with RSS: RSS
© ActivSoftware 1999 to 2005 | Privacy Statement