Results 1 to 13 of 13

Thread: Counting digits, extracting numbers (resolved)

Threaded View

  1. #1

    Thread Starter
    Fanatic Member mikeycorn's Avatar
    Join Date
    Jun 2000
    Location
    Aliso Viejo, CA, USA
    Posts
    526

    Counting digits, extracting numbers (resolved)

    I can get the number of digits in an integer in two functions:

    Digits = Len(Str(intX)) - 1

    But is there a function that does this in one?



    also . . .



    I have various strings like:

    1 day
    2 days
    14 days
    365 days

    And I want to extract just the numbers into another string. Is this the slickest way:

    strNumber = Replace(strDays, " day", vbNullString)
    strNumber = Replace(strDays, "s", vbNullString)



    I know I'm quibbling when it could be said, "if it ain't broke... " but I'm just as concerned with creating streamlined code that's easy to read.
    Last edited by mikeycorn; Feb 20th, 2003 at 09:43 PM.
    ~ mikeycorn

    With over 45,000 Questions in the User Submitted Database, it's the Most Popular Quiz Creation Software on the Net:

    PEST - The Personal Exam Self-Tester

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