什么是 c# 中的 vbNullChar 等价物? [英] what is a vbNullChar equivalent in c#?

查看:50
本文介绍了什么是 c# 中的 vbNullChar 等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 C# 中 Visual basic 'vbNullChar' 的等价物?

What is a equivalent of Visual basic 'vbNullChar" in c# ?

我想在 C# 中复制这个 VB 语句

i want to replicate this VB statement in C#

Dim sVersion As String
sVersion = New String(vbNullChar, 255)

推荐答案

我怀疑你想要:

string sVersion = new string('\0', 255);

(不过,这似乎是一件很奇怪的事情.我会尝试退后一步,看看是否有更合适的方法来解决更大的问题.)

(This seems like an odd thing to want to do though. I would try taking a step back and seeing whether there isn't a more appropriate approach to the bigger problem.)

这篇关于什么是 c# 中的 vbNullChar 等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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