no need for a demo project , just copy the function and paste to your application to use.
this carries out the same function as strReverse does in VB.
VB Code:
[COLOR=Blue]private void[/COLOR] button1_Click([COLOR=Blue]object[/COLOR] sender, System.EventArgs e) { MessageBox.Show(StringReverse("test 123")); } [COLOR=Blue]private string[/COLOR] StringReverse([COLOR=Blue]string[/COLOR] ToReverse) { Array arr = ToReverse.ToCharArray(); Array.Reverse( arr ); [COLOR=Green]// reverse the string[/COLOR] [COLOR=Blue]char[/COLOR][] c = ([COLOR=Blue]char[/COLOR][])arr; [COLOR=Blue]byte[/COLOR][] b = System.Text.Encoding.Default.GetBytes(c); [COLOR=Blue]return[/COLOR] System.Text.Encoding.Default.GetString(b); }





Reply With Quote