Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

find the drive letter in a string

I have a string like this
C:\ColdFusion8\wwwroot\mydocs

how would I find the drive (in this cas "C:")?
0
Shawn
Asked:
Shawn
  • 3
  • 2
1 Solution
 
ShawnAuthor Commented:
yep, figured that..just can't remember the syntax

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



left(mystring ???
0
 
AriMcCommented:
Does this work:

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

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ShawnAuthor Commented:
yes, thank you
0
 
_agx_Commented:
Just for future reference, you could also use list functions

     <cfset driveLetter = listFirst(("C:\ColdFusion8\wwwroot\mydocs", "\/")>
0
 
ShawnAuthor Commented:
thanks agx. i like it
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now