Solved

string breakup options

Posted on 2013-06-20
4
227 Views
Last Modified: 2013-06-21
I have a following string

 INCISE SPINE 3 COLUMN ADL SEGücertified~12/12/2012

ücertified - This thing can be like ücertified, ünoncertified, üpending

so i am trying to remove all characters from right starting from ü

2. Another way i tried using listfirst, tried using a function inside the query like

<cfquery name="GetTitles" DATASOURCE="#dsn#">
  SELECT ArticleID,Title,{fn ListFirst(mystring,'ü')} as mystring
  FROM News
  ORDER BY DatePosted
</cfquery>


also, what if i need to separate this string into 3 different variables, 1 - string , 2 - the status [certified,noncertified, date], 3- date
0
Comment
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 39263689
Use list functions with multiple delimiters:  "ü" and "~"

     <cfset delims = "ü~">
     <cfset theString = getToken( yourString, 1, delims)>
     <cfset theStatus = getToken( yourString, 2, delims)>
     <cfset theDate = getToken( yourString, 3, delims)>
0
 
LVL 15

Author Comment

by:Gurpreet Singh Randhawa
ID: 39263714
oh, Thanks agx,

how i forgot the GetToken

i will try and get back asap
0
 
LVL 15

Author Comment

by:Gurpreet Singh Randhawa
ID: 39263715
but what if i need to remove those values starting from ü~ onwards
0
 
LVL 52

Expert Comment

by:_agx_
ID: 39263729
Split it on the "ü" and grab the first part.  But that's what the code above does.  The results would be:

theString = INCISE SPINE 3 COLUMN ADL SEG    <=== everything before the ü
theStatus = certified
theDate = 12/12/2012
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now