Solved

find the drive letter in a string

Posted on 2011-09-07
6
369 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
[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
  • 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 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