What's the proper way to cast this with Option Strict On?
VB Code:
Dim ReservedChars() As Char = {";", "/", "?", ":", "@", "=", "&"}
Thanks,
KT
Printable View
What's the proper way to cast this with Option Strict On?
VB Code:
Dim ReservedChars() As Char = {";", "/", "?", ":", "@", "=", "&"}
Thanks,
KT
Have you tried DirectCast function ?
But why would you do this ? and to what type do you want to cast it to ?
VB Code:
Dim ReservedChars() As Char = {Char.Parse(";"), Char.Parse("/"), Char.Parse("?"), Char.Parse(":"), Char.Parse("@"), Char.Parse("="), Char.Parse("&")}
Better yet, just put one quote ( ' ) around each character:
edit: Or maybe not, as in VB the ' is commentVB Code:
Dim ReservedChars() As Char = {';', '/', '?', ':', '@', '=', '&'}
Lol spoken like a true C# programmer! :)Quote:
Originally posted by PT Exorcist
Better yet, just put one quote ( ' ) around each character:
edit: Or maybe not, as in VB the ' is commentVB Code:
Dim ReservedChars() As Char = {';', '/', '?', ':', '@', '=', '&'}
This is how you have to do it in VB.NET:
VB Code:
Dim ReservedChars() As System.Char = {";"c, "/"c, "?"c, ":"c, "@"c, "="c, "&"c}
Most excellent, dudes. :afrog:
Appreciate the help as always,
KT