Results 1 to 7 of 7

Thread: [RESOLVED] Character Arrays with Option Strict On

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2004
    Posts
    95

    [RESOLVED] Character Arrays with Option Strict On

    What's the proper way to cast this with Option Strict On?

    VB Code:
    1. Dim ReservedChars() As Char = {";", "/", "?", ":", "@", "=", "&"}


    Thanks,

    KT
    Last edited by Kt3; May 13th, 2004 at 09:55 AM.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Have you tried DirectCast function ?
    But why would you do this ? and to what type do you want to cast it to ?

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    VB Code:
    1. Dim ReservedChars() As Char = {Char.Parse(";"), Char.Parse("/"), Char.Parse("?"), Char.Parse(":"), Char.Parse("@"), Char.Parse("="), Char.Parse("&")}

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Better yet, just put one quote ( ' ) around each character:
    VB Code:
    1. Dim ReservedChars() As Char = {';', '/', '?', ':', '@', '=', '&'}
    edit: Or maybe not, as in VB the ' is comment
    \m/\m/

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Originally posted by PT Exorcist
    Better yet, just put one quote ( ' ) around each character:
    VB Code:
    1. Dim ReservedChars() As Char = {';', '/', '?', ':', '@', '=', '&'}
    edit: Or maybe not, as in VB the ' is comment
    Lol spoken like a true C# programmer!

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    This is how you have to do it in VB.NET:
    VB Code:
    1. Dim ReservedChars() As System.Char = {";"c, "/"c, "?"c, ":"c, "@"c, "="c, "&"c}

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Apr 2004
    Posts
    95
    Most excellent, dudes.


    Appreciate the help as always,

    KT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width