Check format of string 
Author Message
 Check format of string

How to check the format of string as a "YYYYMM"?


Fri, 14 May 2004 22:13:04 GMT  
 Check format of string
Use the Like operator:

    If strYearMonth Like "######" Then
        ' Valid
    End If
--
Michael "The" Gnter, MCSD, MCP (VC++, VB)
Senior Software Engineer
Infinity Software Development, Inc.
Phone: (850) 383-1011 . Fax: (850) 383-1015

Quote:

> How to check the format of string as a "YYYYMM"?



Sat, 15 May 2004 02:37:10 GMT  
 Check format of string
You can use the format function and see if it returns the exact same string.
If it does, then the format was valid.

If Format(sText, "YYYYMM") = sText Then
    'Format is valid
End If

Quote:

> How to check the format of string as a "YYYYMM"?



Sat, 15 May 2004 06:26:10 GMT  
 Check format of string
print format("200109", "yyyymm")
244711


Quote:
> You can use the format function and see if it returns the exact same
string.
> If it does, then the format was valid.

> If Format(sText, "YYYYMM") = sText Then
>     'Format is valid
> End If




Quote:
> > How to check the format of string as a "YYYYMM"?



Sat, 15 May 2004 23:17:29 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Check format of string

2. Not able to format with String.Format

3. formatting numbers for check writing

4. Password format checking

5. Check database format?

6. how to check time format?

7. Data format check

8. Check user entry of the correct date format

9. Format check

10. Format Check

11. Format Check

12. Checking formatting!

 

 
Powered by phpBB® Forum Software