Solved

string breakup options

Posted on 2013-06-20
4
225 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
Question by:myselfrandhawa
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
Comment Utility
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:myselfrandhawa
Comment Utility
oh, Thanks agx,

how i forgot the GetToken

i will try and get back asap
0
 
LVL 15

Author Comment

by:myselfrandhawa
Comment Utility
but what if i need to remove those values starting from ü~ onwards
0
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

14 Experts available now in Live!

Get 1:1 Help Now