<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7784741889047536617</atom:id><lastBuildDate>Thu, 05 Sep 2024 11:25:51 +0000</lastBuildDate><category>extension methods</category><category>IndexOf</category><category>Substring</category><category>case-insensitive</category><title>Usefull C# Code Snippets</title><description></description><link>http://csharptidbits.blogspot.com/</link><managingEditor>noreply@blogger.com (Jacco)</managingEditor><generator>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7784741889047536617.post-7903996433813129106</guid><pubDate>Sat, 07 Mar 2009 08:33:00 +0000</pubDate><atom:updated>2009-03-07T00:48:51.161-08:00</atom:updated><title>Nice XmlWriter extender</title><atom:summary type="text">Sometimes I just like to write some code. I try to think of something to make usage of framework parts even better. I remembered the burnden of writing and XML file using the XmlWriter class. Loosing track of all the WriteStartXXX and WriteEndXXX in a method can be hard to fix and Visual Studio removing any indenting when reformatting is accidently executed doesn&#39;t help.I saw the Tracer class in </atom:summary><link>http://csharptidbits.blogspot.com/2009/03/nice-xmlwriter-extender.html</link><author>noreply@blogger.com (Jacco)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7784741889047536617.post-1005255545326010470</guid><pubDate>Sat, 24 May 2008 20:33:00 +0000</pubDate><atom:updated>2008-05-25T22:02:08.292-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">case-insensitive</category><category domain="http://www.blogger.com/atom/ns#">extension methods</category><category domain="http://www.blogger.com/atom/ns#">IndexOf</category><title>Making shortcuts for case-insensitive String.IndexOf</title><atom:summary type="text">Extension methods in C# allow programmers to correct situations where .NET does not provide the easiest way to do things. Most of the times when I want to do a String.IndexOf, it is the case insensitive version I need. .NET defaults to the most sensitive version. In c# the following code is needed to perform such a call:  if (str.IndexOf(&quot;test&quot;, StringComparison.OrdinalIgnoreCase) &gt;= 0) {    ...</atom:summary><link>http://csharptidbits.blogspot.com/2008/05/making-shortcuts-for-case-insensitive.html</link><author>noreply@blogger.com (Jacco)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7784741889047536617.post-1401970740244896053</guid><pubDate>Sat, 24 May 2008 12:18:00 +0000</pubDate><atom:updated>2008-05-25T22:00:23.274-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">extension methods</category><category domain="http://www.blogger.com/atom/ns#">Substring</category><title>A System.String extension method Substring</title><atom:summary type="text">Almost every time I use String.Substring() I have to do a few IndexOf calls to find the &quot;startIndex&quot; en &quot;length&quot; to use. This includes declaring local variables and verifying that the index found is not smaller than zero. This extension method solves these issues. (Long live C# 3.0!)public static string Substring(this String str, string startText, string endText, StringComparison comparisonType){</atom:summary><link>http://csharptidbits.blogspot.com/2008/05/systemstring-extension-method.html</link><author>noreply@blogger.com (Jacco)</author><thr:total>0</thr:total></item></channel></rss>