How do I determine if the two rightmost elements of my string are ."

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

How can I determine if the two rightmost elements of my string are ."
?

Obviously, vb.net has a special use for the double-quote character, so how
do I account for that.

I have...

if microsoft.visualbasic.right(mystring, 2) = ??????? Then


I need to know what to put in place of those question marks.

Thanks,

-Dave
 
Use the EndsWith function of the string. I would recommend not using
anything of the old VB function placed into microsoft.visualbasic.

What character are you looking for? a period? double quotes?
 
My rightmost elements are a period followed by a double-quote. I'll check
out that EndsWith function.
 
Dave said:
My rightmost elements are a period followed by a double-quote. I'll check
out that EndsWith function.

You can encode double quotes inside string literals by two consecutive
double quotes, for example:

\\\
MsgBox("He said: ""Hello world!""")
///
 
Dave,

Maybe is this something when you become complete crazy from all those double
quotes
\\\
Dim a As String = """"""""""""""""""""""""""""""""""""""""""
Dim b As Integer = 0
For Each chra As Char In a
If chra = Chr(34) Then
b += 1
End If
Next
///

Just as idea

Cor
 

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