.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Post New Resource Bookmark and Share   

String Concat

Posted By:Majith       Posted Date: September 06, 2010    Points: 5    Category:    URL: http://www.dotnetspark.com  

This code is replacement of '+' operator into string.concat().

In C# there are lot of coding functionality uses + operator to concatinating the strings.

For performance we can use string.concat() method instead of that.If the string operations are to large then we can use sting builder.

 Sample Code:

  DataRow [] dr = dt.select("EmpId=' " + txtEmpId.Text + " ' ");

 Replacement Code: 

  DataRow [] dr = dt.select(string.concat("EmpId=",txtEmpId.Text));










Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend