C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






String Manipulation - Clone and Trim function


Posted Date: 14 Aug 2008    Resource Type: Articles    Category: .NET Framework

Posted By: D.Jeya kumar(JK)       Member Level: Diamond
Rating:     Points: 10



String manipulation in C#

Clone
It will just clone a string to another string and once cloned and by modifying the original string will not affect the cloned value.


Below is the example which shows the use of it
String strManipulation="My nick name is jk";
string strclone;
strclone= strManipulation.Clone().ToString();
strManipulation += "sdgfsdgsDG";
strclone += " test";
MessageBox.Show(strclone + " " + strManipulation);


Trim Functions
Trim is to remove all the spaces at the beginning of the string or at the end of the string. It has three types of functions Trim, Trimstart, TrimEnd.
Trim will remove all occurrence of the white space from the beginning and at the end of the string. TrimStart will remove all the occurrence of the white space from the beginning. TrimEnd will remove all the occurrence of the white space at the end of the string.


Example
For Trim()
string strtrim = " My nick name is jk ";
MessageBox.Show("-" + strtrim + "-");
strtrim = Trimfunction(strtrim);
strtrim.Trim();
MessageBox.Show("-" + strtrim + "-");

For TrimStart()
string strtrimstart = " My nick name is jk ";
MessageBox.Show("-" + strtrimstart + "-");
strtrim.TrimStart();
MessageBox.Show("-" + strtrimstart + "-");

For Trimend()
string strtrimend = " My nick name is jk ";
MessageBox.Show("-" + strtrimend + "-");
strtrim.Trimend();
MessageBox.Show("-" + strtrimend + "-");




Continued...




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Trim  .  String Manipultaion  .  String Manipulation  .  Clone  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Discovery file and Delopying a Web service
Previous Resource: Passing only values without parameters for Stored Procedure
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

online optimum rewards

Contact Us    Privacy Policy    Terms Of Use