Assigning an Character

  • Thread starter Thread starter anil
  • Start date Start date
A

anil

Hi everybody,

I have some n number of Names, the string i am declaring should take
any names,

for Ex: As for searching any file we use "*.*" is there any thing
simillar to this that i can use in VB code to specify any string.

Thanks & Regards
Anil.Hungund
 
You can use the LIKE operator on strings:

If value Like "AB###" then ok = True

? = single character, * = 0 or more characters, # = single digit

You can include or exclude characters in the search by inserting a list
enclosed in a pair of sq brackets.

You exclude with !

If value Like "[A-C]####" then ok = true --> 1st is A B or C, then 4 digits

If value like "[!A-C]####" then ok = True --> 1st is not A or B or C, then
4 digits

Look for only alpha characters: If Not (value like (*[!A-Za-z]*")

Look for only digits: If Not (value like "*[0-9]*")

Look for any character but no consecutive punctuation symbols:

If Not (value Like "*[:;.,][:;.,]") then ok=true

This is faster than regex, but slower than manually comparing strings.

HTH,
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
 
Is there a pattern that will check a possible full path

C:dir1\dir2...\name.extension

to see if it is a valid string for the file system?

Thanks


RobinS said:
You can use the LIKE operator on strings:

If value Like "AB###" then ok = True

? = single character, * = 0 or more characters, # = single digit

You can include or exclude characters in the search by inserting a list
enclosed in a pair of sq brackets.

You exclude with !

If value Like "[A-C]####" then ok = true --> 1st is A B or C, then 4
digits

If value like "[!A-C]####" then ok = True --> 1st is not A or B or C, then
4 digits

Look for only alpha characters: If Not (value like (*[!A-Za-z]*")

Look for only digits: If Not (value like "*[0-9]*")

Look for any character but no consecutive punctuation symbols:

If Not (value Like "*[:;.,][:;.,]") then ok=true

This is faster than regex, but slower than manually comparing strings.

HTH,
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
anil said:
Hi everybody,

I have some n number of Names, the string i am declaring should take
any names,

for Ex: As for searching any file we use "*.*" is there any thing
simillar to this that i can use in VB code to specify any string.

Thanks & Regards
Anil.Hungund
 
That sounds like a question for the Regular Expressions experts. Anyone?

Robin S.
--------------------------
active said:
Is there a pattern that will check a possible full path

C:dir1\dir2...\name.extension

to see if it is a valid string for the file system?

Thanks


RobinS said:
You can use the LIKE operator on strings:

If value Like "AB###" then ok = True

? = single character, * = 0 or more characters, # = single digit

You can include or exclude characters in the search by inserting a list
enclosed in a pair of sq brackets.

You exclude with !

If value Like "[A-C]####" then ok = true --> 1st is A B or C, then 4
digits

If value like "[!A-C]####" then ok = True --> 1st is not A or B or C,
then 4 digits

Look for only alpha characters: If Not (value like (*[!A-Za-z]*")

Look for only digits: If Not (value like "*[0-9]*")

Look for any character but no consecutive punctuation symbols:

If Not (value Like "*[:;.,][:;.,]") then ok=true

This is faster than regex, but slower than manually comparing strings.

HTH,
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
anil said:
Hi everybody,

I have some n number of Names, the string i am declaring should take
any names,

for Ex: As for searching any file we use "*.*" is there any thing
simillar to this that i can use in VB code to specify any string.

Thanks & Regards
Anil.Hungund
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top