Easy one. formatting text

Results 1 to 2 of 2

Thread: Easy one. formatting text

  1. #1
    Join Date
    Dec 1969

    Default Easy one. formatting text

    In ASP.NET, how do I take a string like dirobby and remove the dir ?

  2. #2
    Join Date
    Dec 1969

    Default RE: Easy one. formatting text

    i&#039;m assuming you&#039;re trying to manipulate the directory structure? if so, i&#039;ve found the best way to do this is to use the Split() method of String. of course this only works if there&#039;s a common delimeter you&#039;re aware of before hand. here&#039;s an example<BR><BR>&#039;============================= =========================<BR>Dim sPath As String = "rootdirobby"<BR>Dim arrPath As Array = sPath.Split("\")<BR>&#039;======================== ==============================<BR><BR>this breaks the string up and places the delimeted text into an array. in your case to access "bobby" you just need to do<BR><BR>&#039;====================<BR>arrPath(2) <BR>&#039;====================<BR><BR>hope this helps,<BR>n1ckP<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts