C# String Tips and Tricks

This article provides Tips and Tricks for using string in C#.Net.

1. Passing Double Quotes (“) in C# String

Most of the applications are required to pass a string with double quotes to the sqlparameter to execute a stored procedure.

Output
C# Doube Quote  in string
2. C# string reverse

Unfortunately Reverse() function is not available in C# string class, so we can use following approach to reverse string:

Output
C# reverses strings

3. Search string in c# RichTextBox

The Find method of the RichTextBox control searches for string given in the string parameter. If string found it returns the first character position of the search string in the RichTextBox. If the text is not found, the Find method returns -1. By specifying the same value for the start position and the end position, the Find() finds the entire string, starting from the zero position.

Output
search string in richTextBox

4. c# string split

This C# tip shows the string.Split method. It uses a character to split given string.

Output
c# string split

About the Author

has written 6 posts.

I work as a freelance consultant and is passionate about taking challenges in all technologies. I am a software consultant and trainer with 8+ years experience in designing, development and maintaining enterprise wide applications. My interests involves Programming, Website development, Learning and Teaching subjects related to Computer Science and Information technology.

Copyright © 2017 http://www.techzoo.org. All rights reserved.
Proudly powered by WordPress. Developed by 7Tech Solutions