Home
Forums
Programming
Web Development
Tutorials
Snippets
Blogs
Freelance
Jobs
Lounge
Login
Join for Free!
Programming Help
C and C++
Visual Basic
Java
VB.NET
C#
ASP.NET
PHP
ColdFusion
Perl and Python
Ruby
Databases
Other Languages
Game Programming
Software Development
Computer Science
Industry News
Web Development
Web Development
HTML & CSS
JavaScript
Graphic Design
Flash & ActionScript
Blogging
SEO & Advertising
Web Servers & Hosting
Site Check
What's Here?
Members:
137,213
Replies:
481,423
Topics:
75,054
Snippets:
2,567
Tutorials:
675
Total Online:
2,272
Members:
109
Guests:
2,163
Code Snippets
C# Source Code
Welcome to Dream.In.Code
Become a C# Expert!
Join 137,213 C# Programmers for FREE!
Get instant access to thousands
of C# experts, tutorials, code snippets, and more! There are 2,272 people online right now.
Registration is fast and FREE...
Join Now!
Chat
LIVE
With a C# Expert
Reverse a string
This is a snippet for reversing a string
Submitted By:
PsychoCoder
Actions:
Rating:
0
1
2
3
4
5
Views:
360
Language:
C#
Last Modified:
August 5, 2008
Snippet
public
string
ReverseString
(
string
str
)
{
char
[
]
array =
new
char
[
str.
Length
]
;
int
len = str.
Length
-
1
;
for
(
int
i =
0
; i <= len; i++
)
{
array
[
i
]
= str
[
len - i
]
;
}
return
new
string
(
array
)
;
}
Copy & Paste
public string ReverseString(string str) { char[] array = new char[str.Length]; int len = str.Length - 1; for (int i = 0; i <= len; i++) { array[i] = str[len - i]; } return new string(array); }
Comments
There are currently no comments for this snippet. Be the first to comment!
Add comment
You must be registered and logged on to </dream.in.code> to leave comments.
Advertising
|
Terms of Use
|
Privacy Policy
|
About Us
|
Site Map
Forum Index:
Programming Help
|
C and C++
|
Visual Basic
|
Java
|
VB.NET
|
C#
|
ASP.NET
|
PHP
|
ColdFusion
|
Perl and Python
|
Ruby
|
Databases
|
Other Languages
|
Game Programming
|
Software Development
|
Computer Science
|
Industry News
|
Programming Tutorials
|
C++ Tutorials
|
Visual Basic Tutorials
|
Java Tutorials
|
VB.NET Tutorials
|
C# Tutorials
|
PHP Tutorials
|
Linux Tutorials
|
ColdFusion Tutorials
|
Windows Tutorials
|
HTML/JavaScript Tutorials
|
CSS Tutorials
|
Flash Tutorials
|
Web Promotion Tutorials
|
Photoshop Tutorials
|
Software Development Tutorials
|
Database Tutorials
|
Other Language Tutorials
|
Copyright 2001-2008
MediaGroup1 LLC
, All Rights Reserved
A
MediaGroup1 LLC
Production - Version 6.0.2.1.36
Search
Updated!
w00t
Over 509,000 Pages!
Advanced Forum Search
Live C# Help!
C# Tutorials
Serial Port Communication in C#
Basic Client/Server Chat Application in C#
C# Basics Quick Reference (Cheat Sheet)
Create an AutoComplete TextBox Control in C#
C# - Reading each character of a string
Cross Thread Communication in C#
Basic Calculator in C#
C# Flags
Disable an applications close button
Read config file in Class Library
69 More C# Tutorials...
Reference Sheets
C# Snippets
Populating Tree View nodes from sql server 2000
Get connection string from the web.config
Read value from Resource file in C#
Validate IP address with Regular Expression
TreeView Drag n Drop
Search Text file for String
Clear a form
DataGridView - Get Selected List
Get checked item in gridView (ASP.Net) and store in session
Find all classes within a Namespace
247 More C# Snippets...
DIC Chatroom
Join our IRC Chat
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
LifeHacker
(50)
sharpy
(50)
KYA
(50)