Splitting a string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cjac
    New Member
    • Sep 2006
    • 1

    Splitting a string

    lets say i have the string : .2401.32613.592 1.
    is it possible to make vb split it into seperate sections like this 2401 32613 and 5921, without the dots and then perform a function on each one? The dots are just used to seperate each "number.

    thanks to anyone who wants to help.
  • godsent
    New Member
    • Aug 2006
    • 33

    #2
    Originally posted by cjac
    lets say i have the string : .2401.32613.592 1.
    is it possible to make vb split it into seperate sections like this 2401 32613 and 5921, without the dots and then perform a function on each one? The dots are just used to seperate each "number.

    thanks to anyone who wants to help.

    use substring function
    eg
    strNum="2401.32 613.5921"
    strNum1=strNum. Substring(0,4)
    'This will return u 2401

    (0,4)--0 is the starting index, an 4 is the number of characters...

    then u do the same for the remaining numbers as well..

    wen u separate the number then u concacatenate the without dots..

    Comment

    • Hemant Pathak
      Recognized Expert New Member
      • Jul 2006
      • 92

      #3
      Hi cjac
      2401.32613.5921 .
      ya is it possible to make vb split it into seperate sections like this 2401 32613 and 5921
      Just u use this VB function
      'Array declaration
      dim str() as string
      dim mstr as string
      mstr="2401.3261 3.5921."
      str=split(mstr, ".")
      this function is return a array string without dot.u get this all array use LBOUND and UBOUND

      enjoy.......... .....

      Comment

      Working...