Strings


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Strings

  1. #1
    Join Date
    Nov 2004
    Location
    UK
    Posts
    185

    Strings

    Hi,

    I have a string "a 1 23 ad J181DNU"

    Everything before the first Capital Letter i.e. J is data i do not need.

    How could i write some code which would firstly read the string for capital letter, upon finding the capital letter replaces everything before it with nothing?

    Any ideas or suggestions would be appreciated.
    Thankyou

  2. #2
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    See earlier thread http://forums.devx.com/showthread.php?t=142696 and just make a few changes to what you would do in the Select Case statement
    Code:
    Select Case mid$(aString,i,1)
       case "A" To "Z"
          bCapitalFound = True
       case else
          if bCapitalFound then
             aNewString = mid$(aString,i,1)
          endif
    eEnd Select
    Note: you could also exit the loop instead of setting 'bCapitalFound = True' and then set aNewString = mid$(aString,i+1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center