Returns string with count characters removed from a specified starting position. Return 0 if no characters are found.
RemoveChars(string, start, count)
Parameter |
Description |
---|---|
string |
A string |
start |
Starting position for the search |
count |
Number of characters to remove |
<!--- This example shows the use of RemoveChars ---> <html> <head> <title> RemoveChars Example </title> </head> <body bgcolor = silver> <H3>RemoveChars Example</H3> Returns a string with <I>count</I> characters removed from the starting position. Returns 0 if no characters are found. <cfif IsDefined("FORM.myString")> <cfif Evaluate(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> ...