[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

REMOVING PART OF A STRING

Posted on 2006-05-10
6
Medium Priority
?
181 Views
Last Modified: 2013-12-24
I have a string that resides in a table called itemresponse, and the field name is youranswer.  In the youranswer field I have a string that looks like
response~A^correct~1^confirmed~0 or response~B^Correct~0  Is there a way to use Cold Fusion to update youranswer field and get rid of everything after Correct~0 so that the strings that are response~B^correct~0^confirmed~1 turn into response~A^correct~1?  The are about 500K answers in this field and like I said, some are already the shorter version while most of them are the long string.

Any help would be appreciated
Thanks
Nick
0
Comment
Question by:nmarano
  • 3
  • 2
6 Comments
 
LVL 21

Assisted Solution

by:pinaldave
pinaldave earned 800 total points
ID: 16650207
Hi nmarano,
 
left('response~A^correct~1^confirmed~0',find("Correct~0","response~A^correct~1^confirmed~0"))

would do it for you.

Regards,
---Pinal
0
 
LVL 3

Accepted Solution

by:
pcaioo earned 1200 total points
ID: 16654508
I think think helps you better

<cfset youranswer = replace(youranswer,"^confirmed~0","">
<cfset youranswer = replace(youranswer,"^confirmed~1","">

so ^confirmed~1 and ^confirmed~0 will both be removed


0
 
LVL 2

Author Comment

by:nmarano
ID: 16657358
Thanks for the help
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
LVL 3

Expert Comment

by:pcaioo
ID: 16659508
are you accepting my answer or his ??? as i got good assist email ??? confused
0
 
LVL 2

Author Comment

by:nmarano
ID: 16666616
I accepted yours, but split the points 200 to him, 300 to you with a grade of A
0
 
LVL 3

Expert Comment

by:pcaioo
ID: 16672394
O sorry as I never ask question so not quite know how it work...
is it means both of us will receive a Assisted Answer email ??
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question