首页
话题
动态
专家
文章
作者
公告
更多
积分规则
登录 或 注册
首页
话题
动态
专家
文章
作者
公告
积分规则
发表新帖
发表新帖
VB to C# Functions
后端
未结
关注
14
1047
忘了有多久
2020-12-02 06:51
Which are the equivalent of the following operators from VB.Net to C#?
UBound()
LBound()
IsNothing()
<
14条回答
春和景丽
(楼主)
2020-12-02 07:31
UBound() -> if x is an array of string[] for example: x.GetUpperBound();
LBound() -> if x is an array of string[] for example: x.GetLowerBound();
IsNothing() -> if (x == null)
Chr() -> char x = (char)65;
Len() -> x.Length();
UCase() -> assume x is a string: x.ToUpper();
LCase() -> assume x is a string: x.ToLower();
Left() -> assume x is a string: x.Substring(0, 10); // first 10 characters
Right() -> assume x is a string: x.Substring(x.Length - 10); // last 10 characters
RTrim() -> x.TrimEnd();
LTrim() -> x.TrimStart();
Trim() -> x.Trim();
Mid() -> assume x is a string: x.Substring()
Replace() -> assume x is a string: x.Replace();
Split() -> assume x is a string: x.Split();
Join() -> String.Join();
MsgBox() -> MessageBox.Show();
IIF() -> ternary operator (x == true ? true-value : false-value);
0
讨论(0)
查看其它14个回答
发布评论:
提交评论
加载中...
验证码
看不清?
提交回复
热议问题