VB C#
UBound() = yourArray.GetUpperBound(0) or yourArray.Length for one-dimesional arrays
LBound() = yourArray.GetLowerBound(0)
IsNothing() = Object.ReferenceEquals(obj,null)
Chr() = Convert.ToChar()
Len() = "string".Length
UCase() = "string".ToUpper()
LCase() = "string".ToLower()
Left() = "string".Substring(0, length)
Right() = "string".Substring("string".Length - desiredLength)
RTrim() = "string".TrimEnd()
LTrim() = "string".TrimStart()
Trim() = "string".Trim()
Mid() = "string".Substring(start, length)
Replace() = "string".Replace()
Split() = "string".Split()
Join() = String.Join()
MsgBox() = MessageBox.Show()
IIF() = (boolean_condition ? "true" : "false")
- UBound() —
arrayVar.Length
- LBound() — obsolete, lower bound is always 0 in a normal .Net array
- IsNothing() — obsolete. Use
Is Nothing
in VB.Net and == null
in C#
- Chr() —
Convert.ToChar()
or (char)someVar
- Len() —
stringVar.Length
use this in VB too
- UCase() —
stringVar.ToUpper()
use this in VB too
- LCase() —
stringVar.ToLower()
use this in VB too
- Left() —
stringVar.Substring(0, n)
use this in VB too
- Right() —
stringVar.Substring(stringVar.Length - n)
use this in VB too
- RTrim() —
stringVar.TrimEnd()
use this in VB too
- LTrim() —
stringVar.TrimStart()
use this in VB too
- Trim() —
stringVar.Trim()
use this in VB too
- Mid() —
stringVar.Substring(n, m)
use this in VB too
- Replace() —
stringVar.Replace()
use this in VB too
- Split() —
stringVar.Split()
use this in VB too
- Join() —
String.Join()
use this in VB too
- MsgBox() —
MessageBox.Show()
- IIF() —
(condition) ? truepart : falsepart
- note that there are some differences, because "?" is an operator and not a function
Comments
Post a Comment