Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 118,691 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 1,146 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Reverse a string

 
Reply to this topicStart new topic

Reverse a string

gbertoli3
post 4 Aug, 2008 - 07:58 PM
Post #1


DIC at Heart + Code

Group Icon
Joined: 23 Jun, 2008
Posts: 812



Thanked 12 times

Dream Kudos: 750
My Contributions


I have tried searching for how to reverse a string but can not find anything.
I know that dream.in.code has a policy of showing your effort before asking for help, but I can not find anything.
I can't even guess how to reverse a string.
So can anyone help
or
Give me some links

You do not have to do it, but I would like a sample or some links to a sample

Thanks.
User is offlineProfile CardPM

Go to the top of the page


PsychoCoder
post 4 Aug, 2008 - 11:51 PM
Post #2


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,918



Thanked 83 times

Dream Kudos: 8100

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


Here is a snippet used for reversing a string. Also, here is a snippet that will reverse a string using XOR logic.

Hope that helps smile.gif
User is online!Profile CardPM

Go to the top of the page

gbertoli3
post 5 Aug, 2008 - 07:45 AM
Post #3


DIC at Heart + Code

Group Icon
Joined: 23 Jun, 2008
Posts: 812



Thanked 12 times

Dream Kudos: 750
My Contributions


Thanks PsychoCoder
User is offlineProfile CardPM

Go to the top of the page

eclipsed4utoo
post 6 Aug, 2008 - 05:38 AM
Post #4


D.I.C Head

**
Joined: 21 Mar, 2008
Posts: 159



Thanked 8 times
My Contributions


here is another way..

csharp

string strString = "reverse";
string strTemp = "";
for (int i = strString.Length - 1; i >= 0; i--)
{
strTemp = strTemp + strString.Substring(i, 1);
}
return strTemp;
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/12/08 07:58AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month