[thelist] CF Question: Permutation of right(string, count)

Seth Bienek seth at sethbienek.com
Mon Jan 8 17:37:26 CST 2001

Or, shorthand, using right() instead of mid (only works at the end of a
string), and compund functions:

<!--- Create a string with our sample text. --->
<cfset content = "foo,bar">

<!--- Get the position of the first comma in the string,
	and parse the number of letters between it and
	the end of the string minus one (to accommodate
	the comma). --->
<cfset newcontent = right(content, (find(",", content) - 1))>



Seth Bienek
Solutions Development Manager
Stonebridge Technologies, Inc.
972.455.7294 tel
972.404.9754 fax

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of Minh Lee Goon
> Sent: Monday, January 08, 2001 3:23 PM
> To: evolt
> Subject: [thelist] CF Question: Permutation of right(string, count)
> Dear evolta,
> I would like to retrieve only the characters to the right of a comma. I
> tried using the right(string, count) expression but the number of
> characters after the comma isn't always constant so I'm bound to get
> errors. For example, if my string is "foo,bar" I'd like to retrieve
> "bar" only.
> I was wondering if there's a quick and easy way of retrieving the
> characters to the right of a comma, instead of n number of characters
> from the right.
> </ml>

More information about the thelist mailing list