Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

string breakup options

Posted on 2013-06-20
4
Medium Priority
?
243 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 2000 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

Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

Question has a verified solution.

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

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

660 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