Solved

find the drive letter in a string

Posted on 2011-09-07
6
351 Views
Last Modified: 2013-12-24
I have a string like this
C:\ColdFusion8\wwwroot\mydocs

how would I find the drive (in this cas "C:")?
0
Comment
Question by:Shawn
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:AriMc
ID: 36499258
0
 
LVL 1

Author Comment

by:Shawn
ID: 36499365
yep, figured that..just can't remember the syntax

<cfset mystring = "C:\ColdFusion8\wwwroot\mydocs">



left(mystring ???
0
 
LVL 9

Accepted Solution

by:
AriMc earned 500 total points
ID: 36499404
Does this work:

<cfset mystring = Left("C:\ColdFusion8\wwwroot\mydocs", 2)>

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Closing Comment

by:Shawn
ID: 36499447
yes, thank you
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36500102
Just for future reference, you could also use list functions

     <cfset driveLetter = listFirst(("C:\ColdFusion8\wwwroot\mydocs", "\/")>
0
 
LVL 1

Author Comment

by:Shawn
ID: 36500230
thanks agx. i like it
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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

21 Experts available now in Live!

Get 1:1 Help Now