how can I convert strcat to c#

  • Thread starter Thread starter Guest
  • Start date Start date
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 " );
}
 
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
 
Back
Top