Using the unsafe keyword

image_pdfimage_print

using System;

class Test {
public static unsafe String UnsafeCodeExample( String s ) {
int strLength = s.Length;
char[] str = new char[strLength+1];
string strReturn = “”;

fixed(char* strPointer = str) {
for ( int i=0; i