Trimimng a string to a numeric character hmm..

Discussion in 'Software' started by unclematty, May 11, 2004.

  1. unclematty

    unclematty Private First Class

    My father is a Horse Race handicapper and I am writing him a windows app. All it does is locate a string in one file and move it to another file. The string can be any where from -- to 65 characters long. So I am finding the first chars which identify the line and then taking the next 65 chars.

    The substring that I pull can look like these...
    Top 3: 6-5-1 Speed: 6-5-4 Class: 6-5-1 Pace: 6-5-1 Pg# Hor
    Top 3: 62-25-31 Speed: 36-53-44 Class: 63-53-13 Pace: 36-35-13

    The substrings can be any combination of single or double digit numbers. Since i pull all 65 chars, I am getting unwanted chars(Pg# Hor) at the end of any substring not loaded with all double digits numbers.

    That is my problem. So I want to trim the substring down from the left until it hits a numeric character. Does anyone know how I could do this?
     
  2. unclematty

    unclematty Private First Class

    Forgot to mention. I am doing the project in vb.net
     
  3. Kodo

    Kodo SNATCHSQUATCH

  4. fibdev

    fibdev Private E-2

    Use a Char array to parse the substring until it hits a numeric value. I haven't touched VB in years, so the best I can do is give you a delphi example...
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds