By tag: string
0
kicks
Replacing Web.config settings with Transformations
Let’s say you want to point to a different connection string when you deploy your ASP.NET Web Project to your hosting provider. Until recently you’d have to modify your Web.config file manually. This is an easy procedure but you might end screwing up the file in some way.
Visual Studio 2010 comes w...
0
kicks
String templates revisited
Sometimes I encounter a task - create some little template, that user can easily configure. Yeah, there are many powerful template engines, or you can use {0}, {1} placeholders, or even handwritten #Id#, #Name# placeholders. But this article describes yet another way - simple and descriptive string ...
0
kicks
Load XML from string instead of file in C#.NET | syntaxhelp.com
Cheat sheet for reading XML from string
0
kicks
System.String Vs System.Text
Strings of type System.String are immutable (read-only) in .NET because its value cannot be modified once it has been created. That means any change to a string causes the runtime to create a new string object and abandon the old one. That happens invisibly. Following code allocates three new string...
0
kicks
Function to Encrypt String in C# .Net using SHA1 Algorithm
SHA stands for Secure Hash Algorithm. This hash algorithm are applied to encrpt the string and store in un-readable format. SHA-1 is the best established of the existing SHA hash functions, and is employed in several widely used security applications and protocols. SHA-1 is implemented in .Net using...
0
kicks
HtmlTextWriter to String in Asp.net C#
Convert HTMLTextWriter output to string usinf StringBuilder & StringWriter class
0
kicks
30 Common String Operations in C# and VB.NET – Part II
In the previous article, 30 Common String Operations in C# and VB.NET – Part I, we explored 15 common String operations while working with the String class. In Part II of the article, we will continue with the series and cover 15 more.
0
kicks
C# String Theory
This article shows the differences between string versus String versus StringBuilder. It details when and how to use the C# String and StringBuilder classes.
0
kicks
Setting StringBuilder's Initial Capacity for Extreme Performance
You must have come across plenty of articles on the internet which talk about using the StringBuilder class when computing large strings for performance gains. Nothing wrong with that. However I have not seen many coders using the Initial Capacity constructor of the StringBuilder class which can fur...
0
kicks
How to: Optimize the memory usage with strings
System.String type is used in any .NET application. We have strings as: names, addresses, descriptions, error messages, warnings or even application settings. Each application has to create, compare or format string data. Considering the immutability and the fact that any object can be converted to ...
0
kicks
How to: Optimize the strings’ comparison
Due to my web research I found some useful tips about how to compare two strings making full use of performance in .NET Framework.
0
kicks
When string.ToLower() is Evil
Did you know how evil string.ToLower() can sometimes be? See an example when string.ToLower() is definitely not an option.
0
kicks
Extending the string object in c#
Four methods to extend your string, ToCamel(), Capitalize(), CapitalizeAll() and ToPascal().
0
kicks
String Concatenation vs Memory Allocation
Over the years, plenty has been written about string performance, lots of comparisons between String.Concat and StringBuilder. Today I decided to do some of my own research into the subject and contribute to the knowledge already out there. More specifically, I'll be taking a look at the memory usag...
0
kicks
StringBuilder is not always faster
Here is something you may not know about string concatenation: StringBuilder is not always faster.