Results 1 to 8 of 8

Thread: [*resolved] string to char?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    [*resolved] string to char?

    is there a function to convert a string to an array of characters?
    I wrote my own, but just wondering if there is a way to do so
    Last edited by MrPolite; Feb 2nd, 2003 at 02:23 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    Any chance of including your own version in the next update of the VBCodeBook CodePack?
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by RealNickyDude
    Any chance of including your own version in the next update of the VBCodeBook CodePack?
    sure
    VB Code:
    1. Public Shared Function StringToChar(ByVal s As String) As Char()
    2.         If s Is Nothing Then Return Nothing
    3.  
    4.         Dim chars(s.Length - 1) As Char
    5.         Dim i As Integer
    6.         For i = 0 To s.Length - 1
    7.             chars(i) = CChar(s.Substring(i, 1))
    8.         Next
    9.  
    10.         Return chars
    11.     End Function

    would you put my name there?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Junior Member
    Join Date
    Jan 2003
    Location
    Seattle, WA
    Posts
    17
    Is this what your talking about?
    VB Code:
    1. Dim TheWord As String = "Moo"
    2.         Dim Letters() As Char
    3.         Letters = TheWord.ToCharArray()

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by FireRabbit
    Is this what your talking about?
    VB Code:
    1. Dim TheWord As String = "Moo"
    2.         Dim Letters() As Char
    3.         Letters = TheWord.ToCharArray()
    yeah, thanks again, you're the man
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Convert.ToChar()
    \m/\m/

  7. #7

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by PT Exorcist
    Convert.ToChar()
    I believe that doesnt return an array. But thanks for posting... I didnt know a Convert class existed I guess it's the same as CType, CByte, CWhatever functions though
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    actually it isnt the same as ctype...there are conversions ctype can't do and Convert.Toxxxx can do
    \m/\m/

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