Help splitting a string

Results 1 to 3 of 3

Thread: Help splitting a string

  1. #1
    Join Date
    Dec 1969

    Default Help splitting a string

    I am passing from a form, for example, <BR><BR>Doug - 10%<BR><BR>I need to get rid of the - 10% before shiving it into the db. The # of charachters before the " space-space10%" can vary as can the percent after it.<BR><BR>Can sntone help me out here? Feeling really dumb about this.

  2. #2
    Join Date
    Dec 1969

    Default Use InStr() to find..

    .. the " - ".<BR><BR>Then, grab everything to the Left() of that point.

  3. #3
    Join Date
    Dec 1969

    Default Here is a better way

    Dim strName<BR>Dim varTemp<BR> <BR> strName = "doug - 10%" <BR> varTemp=split(strName,"-")<BR><BR>after that the variable varTemp(0) will be equal to doug and the variable varTemp(1) will be equal to 10%.

Posting Permissions

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