Solved

string breakup options

Posted on 2013-06-20
4
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 16

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 16

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
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 …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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