Syntax help

  • Thread starter Thread starter hharry
  • Start date Start date
H

hharry

Hello All,

I have the following code:

response = Encoding.ASCII.GetString(bytes, 0, receivedByteCount)
Dim multiline As Boolean = (response.Chars(3) = "-"c)

What is the purpose of the c character in "-"c



Thanks In Advance
 
hharry said:
response = Encoding.ASCII.GetString(bytes, 0, receivedByteCount)
Dim multiline As Boolean = (response.Chars(3) = "-"c)

What is the purpose of the c character in "-"c

The 'c' suffix marks the character enclosed between the double quotes as a
'Char' instead of a 'String'. '"-"' would create a string (type 'String')
of length 1 consisting of the character "-" while '"-"c' will create a
single character of type 'Char'.
 

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