早教吧 育儿知识 作业答案 考试题库 百科 知识分享

9.VB.NET中,取字符串"thisisatest"的第一个字符,并将其赋值给字符变量ch。下列代码中级是正确A.ch=Char(Mid("thisisatest",0,1))B.ch=CChar(Mid("thisisatest",1,1))C.ch=Char(Mid("thisisatest",1,1))D.ch=CChar(

题目详情
9.VB.NET中,取字符串"this is a test"的第一个字符,并将其赋值给字符变量ch。下列代码中_____级是正确
A.ch=Char(Mid("this is a test",0,1))
B.ch=CChar(Mid("this is a test",1,1))
C.ch=Char(Mid("this is a test",1,1))
D.ch=CChar(Mid("this is a test",0,1))
▼优质解答
答案和解析
D. 要转换成char的话需要CCHAR,提取的话是从0开始所以MID第一个写0,长度为1,这为从0位置开始提取1个字符串