如何在Visual Basic .NET中声明Char文字? [英] How do you declare a Char literal in Visual Basic .NET?

查看:86
本文介绍了如何在Visual Basic .NET中声明Char文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Option Strict On:

Dim theLetterA As Char = "A"

返回有关将字符串"A"转换为Char的错误.

returns an error about converting the string "A" to a Char.

输入Char文字的语法是什么?

What is the syntax to enter a Char literal?

推荐答案

使用带后缀C的单个字符串输入字符文字.

A character literal is entered using a single character string suffixed with a C.

Dim theLetterA As Char = "A"C

这篇关于如何在Visual Basic .NET中声明Char文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆