Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Bill #1
Another String Manipulation Question
Let's say I have a variable like this:
12345432112347890
The characters in the variable will always be different, but my goal will
always be the same:
Throw the first four characters into their own variable, then the next five
into their own variable, then the next five, and finally the next three into
their own variable.
Any ideas?
--
Bill Horvath
Community MX
[url]http://www.communitymx.com[/url]
Bill Guest
-
String Manipulation - Easiest Way?
I have a field in a database that contains records that look like this: I'm trying to find the easiest (i.e. fewest lines of code) way to strip... -
String manipulation
Hi! I am trying to figure out a simple, Perl way to break down any sting similar to the following: $s0 =... -
String Manipulation Before Posting to a Database
Hi All: I am having difficulty with manipulating data coming from a form which is then posted to a database. The from contains a mixture of check... -
String manipulation and category building.
I have been working in this problem for weeks and I was determined to sort it myself however I feel I need guidance to proceed forward. What I am... -
string manipulation problem - Replace
Hi all, I'm new to ASP so this is probably a problem caused by me.... but here goes. I have been pulling some information from an access database... -
cf_menace #2
Re: Another String Manipulation Question
This works, but it's kinda goofy:
<cfscript>
foo = "12345432112347890";
bar = foo;
varOne = Left(bar, 4);
bar = RemoveChars(bar, 1, 4);
varTwo = Left(bar, 5);
bar = RemoveChars(bar, 1, 5);
varThree = Left(bar, 5);
bar = RemoveChars(bar, 1, 5);
varFour = Left(bar, 3);
</cfscript>
cf_menace Guest
-
Bill Horvath .:CMX:. #3
Re: Another String Manipulation Question
Thanks! I'll try this when I get back to the office.
--
Bill Horvath
Free Tutorials for Studio MX
[url]http://www.communitymx.com/free.cfm[/url]
Free 10 Day Trial
[url]http://www.communitymx.com/joincmx.cfm[/url]
"cf_menace" <amoreno@factorsofi.com> wrote in message
news:cv5up4$khk$1@forums.macromedia.com...> This works, but it's kinda goofy:
>
> <cfscript>
> foo = "12345432112347890";
> bar = foo;
>
> varOne = Left(bar, 4);
> bar = RemoveChars(bar, 1, 4);
> varTwo = Left(bar, 5);
> bar = RemoveChars(bar, 1, 5);
> varThree = Left(bar, 5);
> bar = RemoveChars(bar, 1, 5);
> varFour = Left(bar, 3);
> </cfscript>
>
Bill Horvath .:CMX:. Guest
-
Rob #4
RE: Another String Manipulation Question
<CFSCRIPT>
strFull = "12345432112347890";
IF(LEN(strFull) IS 17){
str1 = MID(strFull,1,4);
str2 = MID(strFull,5,5);
str3 = MID(strFull,10,5);
str4 = MID(strFull,15,3);
}
</CFSCRIPT>
Rob Guest
-
zoeski80 #5
Re: Another String Manipulation Question
Wouldn't MID be a better function to use so you don't have to rewrite the bar
variable each time??
Zoe
<cfscript>
foo = "12345432112347890";
first = mid(foo, 1, 4)
second = mid(foo, 5, 5)
third = mid(foo, 10, 5)
fourth = mid(foo, 15, 3)
</cfscript>
zoeski80 Guest



Reply With Quote

