Hi
I am facing a problem with String.CopyTo() method.
I am trying to the copy the value from string to char array using String.CopyTo() method.
Here's my code
Dim strString As String = "Hello World!"
Dim strCopy(12) As Char
strString.CopyTo(0, strCopy, 0, 12)
For Each ch As Char In strCopy
Console.Write(ch)
Next
Can any one point me in the right direction ?
Thanks.
Edit : I get the this error at runtime. ArgumentOutOfRangeException Index and count must refer to a location within the string. Parameter name: sourceIndex