View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > RemoveChars PreviousNext

RemoveChars

Removes characters from a string.

A copy of the string, with count characters removed from the specified start position. If no characters are found, returns zero.

String functions

RemoveChars(string, start, count)

Insert, Len

Parameter

Description

string

A string or a variable that contains one. String in which to search.

start

A positive integer or a variable that contains one. Position at which to start search.

count

Number of characters to remove

<h3>RemoveChars Example</h3>
Returns a string with <I>count</I> characters removed from the 
start position. Returns 0 if no characters are found. <cfif IsDefined("FORM.myString")> <cfif (FORM.numChars + FORM.start) GT Len(FORM.myString)> <p>Your string is only <cfoutput>#Len(FORM.myString)# </cfoutput> characters long. Please enter a longer string, select fewer characters to remove or begin earlier in the string. <cfelse> <cfoutput> <p>Your original string: #FORM.myString# <p>Your modified string: #RemoveChars(FORM.myString, FORM.numChars, FORM.start)# </cfoutput>

Contents > CFML Reference > ColdFusion Functions > RemoveChars PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


skygx said on Aug 17, 2004 at 3:41 PM :
Syntax line states argument order is string, start, count. But example given seems to say that the order is actually string, count, start. Need clarification.
ASandstrom said on Aug 18, 2004 at 12:01 PM :
The correct order of the arguments is string, start, count. The example should read:
#RemoveChars(FORM.myString,
FORM.start, FORM.numChars)#

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa66.htm