We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Adding strings to cfset

JohnLucania
JohnLucania asked
on
Medium Priority
428 Views
Last Modified: 2013-12-24
I have:

<cfscript>
function MakeFormID()
{      
  bla...
}
</cfscript>

<cfset FormIDMade = #MakeFormID()#>

What I want is adding the word, 'Added', onto #MakeFormID()# so that #FormIDMade# can always have the suffix 'Added'.  i.e. if #MakeFormID()# is '68Xf3gw4', then it becomes '68Xf3gw4Added'; if '68H4h7Yv', then '68H4h7YvAdded'.
Comment
Watch Question

Commented:
JohnLucania,

> <cfset FormIDMade = #MakeFormID()#>

<cfset FormIDMade = "#MakeFormID()#Added" />

Regards
Plucka

Commented:
Or,

<cfset FormIDMade = #MakeFormID()#>
<cfset FormIDMade = FormIDMade & "Added">

Regards
Plucka
Commented:
Plucka,

> <cfset FormIDMade = #MakeFormID()#>
> <cfset FormIDMade = FormIDMade & "Added">

Also,

You don't need #'s in function calls so you could without "'s so you could do

<cfset FormIDMade = MakeFormID() />
<cfset FormIDMade = FormIDMade & "Added" />

OR

<cfset FormIDMade = MakeFormID() & "Added" />


Lot's of possibilities.

Regards
Plucka

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Yup.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.