Results 1 to 2 of 2

Thread: Finding a character in a string

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Finding a character in a string

    Hello Everyone:

    What do I use to find the position of a certain character in a string? Let’s say I had a number 12345.6789 I want to know how far the decimal point is from the left? Of course the position of the decimal will change as the number will change.

    Thanks

    Art W.
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Finding a character in a string

    try this:

    vb Code:
    1. dim d as decimal = 12345.6789D
    2. msgbox(d.tostring.indexof("."c))

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