• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Separating Strings

New Here ,
Feb 11, 2008 Feb 11, 2008

Copy link to clipboard

Copied

I have a form field that has 4 characters when submitted. I need to be able to separate these characters and store them in unique variables for later use. Any thoughts?

--- Mid function worked Thanks--
<cfset myVar1= '#Mid(form.field, 1, 1)#'>
<cfset myVar2= '#Mid(form.field, 2, 1)#'>
<cfset myVar3= '#Mid(form.field, 3, 1)#'>
<cfset myVar4= '#Mid(form.field, 4, 1)#'>
TOPICS
Advanced techniques

Views

339

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 11, 2008 Feb 11, 2008

Copy link to clipboard

Copied

Look at the function MID(str,pos,len) in the documentation. If this doesn't help, try reposting your question maybe with a small sample of what you currently have.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 11, 2008 Feb 11, 2008

Copy link to clipboard

Copied

> I have a form field that has 4 characters when submitted. I need to be able to separate these characters and store them in unique variables variables for later use. Any thoughts?

Look @ CFLOOP and mid():

http://livedocs.adobe.com/coldfusion/8/Tags_j-l_11.html

http://livedocs.adobe.com/coldfusion/8/functions_m-r_02.html


--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Feb 11, 2008 Feb 11, 2008

Copy link to clipboard

Copied

LATEST
You could convert the string in the form field to an array.
http://www.cflib.org/udf.cfm?ID=943

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation