how to convert array into string

gary_gill

New member
Joined
May 16, 2005
Messages
1
Location
toronto
Programming Experience
1-3
i have a field called MSGId it contains array of characters .how can i convert that array in to string in vb.net

This msgid is comming from database and its type is raw.I am using vb.net
 
Last edited:

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
if you have char array like this:

VB.NET:
Dim[/color] myArray [color=blue]As[/color] [color=blue]Char[/color]()[font='Courier New'][color=blue]
[/font]

you can do this to convert values between String and Char arrays:

VB.NET:
[/color][/font]Dim[/color][color=#000000] myText [/color][color=blue]As[/color] [color=blue]String[/color][color=#000000] =[/color] [color=blue]CStr[/color][color=#000000](myArray)[/color][/font]
 

[font=Courier New][color=#000000]or [/color][/font]
[font=Courier New][/font] 

[font=Courier New][font=Courier New][color=blue][color=#000000][color=blue][color=#000000][color=blue][font=Courier New][color=blue][font=Courier New][color=blue]
[font=Courier New][color=blue]Dim[/color][color=#000000] myText [/color][color=blue]As[/color] [color=blue]String[/color][color=#000000] =[/color] [color=blue]CType[/color][color=#000000](myArray, [color=blue]String[/color])[/color][/font]
[font=Courier New][color=#000000][/color][/font] 

[color=#000000][font=Courier New][color=blue]Me[/color].MSGId.[color=blue]Text[/color] = myText[font='Courier New'][color=blue]


[/color][/font][/color][/font][/color][/color][/color][/color][/color][/font][/font]Cheers ;)
 
Top Bottom