how can I convert strcat to c#

G

Guest

How can I convert strcat and strcpy to c#
#include <string.h>
#include <stdio.h>

void main( void )
{
char string[80];
strcpy( string, "Hello world from " );
strcat( string, "strcpy " );
}
 
G

Guest

In C#:

void Main()
{
string str = "Hello world from";
str += " strcpy";
}

If you are doing a lot of concatenation you can use the stringbuilder class;
which can preallocate a buffer and append into it...

--Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top