C# convert char array to string
How would I go about converting a character array to a string?
say I have a char array called ca1 its values are b, l, a, h, (0-3) I want to convert it to a string: String TheString = convertthistostring(ca1); is there a function or similar way to do this? |
I found the answer while searching google for forum results, here is what I ended up doing to test it, it worked:
String Bob = "blah!"; char[] bob = Bob.ToCharArray(); String Tet = new String(bob); Console.WriteLine("{0}", Tet); |
Marshalling: Using native DLLs in .NET
Please read the following article:
http://blog.rednael.com/2008/08/29/M...DLLsInNET.aspx It's an in-depth article about wow to use a native DLL (or C++ DLL) in your managed .Net code? The article shows which types are interoperable, how to import a DLL, how to pass strings, how to pass structures and how to de-reference pointers. And C# source code examples are included. |
rednael,
How about trying to answering the OPs question instead of attempting to drive traffic to your blog. It sure doesn't look like the OP is trying to import DLLs. |
All times are GMT -5. The time now is 04:06 AM. |