Results 1 to 2 of 2

Thread: how to convert string into integer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    23

    how to convert string into integer

    does anyone know how to convert string into integer?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: how to convert string into integer

    It really depends on the string:

    say if you have string "123abc" it could be as simple as Val("123abc") wich will produce 123;
    however string "abc123" will result in zero (using Val function) - in this case you 'll need parse it and elliminate all non-numeric chars mfirst'
    There is CInt(), CLng() function that may convert numeric strings to Integer/Long...

    ... however, that is just a tip of an iceberg ...

Posting Permissions

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



Click Here to Expand Forum to Full Width