DotNetShoutout - Stories tagged with String
2
Shouts

C#/.NET Little Wonders: String Padding and Trimming - Not Just for Spaces!

posted by BlackRabbitCoderBlackRabbitCoder 611 days, 18 minutes ago
Friday, September 23, 2011 12:00:30 AM GMT
I’m going to wrap up my little side excursion into the String class with just a quick post on two features we’ve probably all used from time to time, but with a little twist: padding and trimming. Yes, we’ve probably all padded strings with spaces and numbers with zeros before, or trimmed off extra spaces, but did you know these methods aren’t just confined to whitespace? (more)
category: Web Dev | clicked: 0 | comment | | source: www.blackrabbitcoder.net
tags: .NET, String, Little Wonders, C#, CSharp, pad, trim
3
Shouts

C#/.NET Little Wonders: The String Remove() and Replace() Methods

posted by BlackRabbitCoderBlackRabbitCoder 618 days, 37 minutes ago
Thursday, September 15, 2011 11:41:02 PM GMT
When manipulating string data, many times you want to either remove parts of a String or replace characters in a String. You can do this yourself, of course, by building a new String while manually inspecting each char in turn, but this gets to be a bit expensive and is less maintainable. Instead, there are two methods in the String class, ready to use, that let you do this easily: Remove() and Replace(). (more)
category: Web Dev | clicked: 2 | comment | | source: www.blackrabbitcoder.net
tags: .NET, String, Little Wonders, C#, replace, remove, CSharp
4
Shouts

C#/.NET Little Wonders: The String Split() and Join() methods

published 623 days, 14 hours, 48 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 624 days, 23 hours, 51 minutes ago
Saturday, September 10, 2011 9:30:21 AM GMT Friday, September 09, 2011 12:27:32 AM GMT
This post continues a series of Little Wonders in the BCL String class. Yes, we all work with strings in .NET daily, so perhaps you already know most of these. However, there are a lot of little fun things that the String class can do that often get overlooked. Today we are going to look at a pair of String method families to Split() and Join() string data. (more)
category: Web Dev | clicked: 11 | comment | | source: www.blackrabbitcoder.net
tags: .NET, Split, String, join, C#, CSharp
5
Shouts

C#/.NET Little Wonders: An Oft Overlooked String Constructor

published 630 days, 13 hours, 57 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 631 days, 20 hours, 51 minutes ago
Saturday, September 03, 2011 10:20:57 AM GMT Friday, September 02, 2011 3:26:58 AM GMT
I’m going to begin a series of Little Wonders in the BCL String class.  Yes, we all work with strings in .NET daily, so perhaps you already know most of these.  However, there are a lot of little fun things in the C# class that some folks newer to the language may be less aware of. This post takes a look at a version of the String constructor which lets you create strings of a repeated character easily and efficiently. (more)
category: Web Dev | clicked: 24 | comment | | source: www.blackrabbitcoder.net
tags: .NET, String, Little Wonders, C#, constructor, CSharp
2
Shouts

Syetem Data is Formatted to a String by Using Iformattable Interface

published 661 days, 4 hours, 25 minutes ago posted by dotnetsparkdotnetspark 663 days, 22 hours, 52 minutes ago
Wednesday, August 03, 2011 7:53:16 PM GMT Monday, August 01, 2011 1:26:31 AM GMT
In This article you will learn how to use Informattable Interface to format System Data to String. (more)
category: How To | clicked: 10 | comment | | source: www.dotnetspark.com
tags: Iformattable, String, DotNetSpark
4
Shouts

C# Strings – Getting Started with Strings

published 699 days, 4 hours, 34 minutes ago posted by JudoJudo 703 days, 13 hours, 9 minutes ago
Sunday, June 26, 2011 7:43:52 PM GMT Wednesday, June 22, 2011 11:09:14 AM GMT
Working with strings is a very common task for most C# developers. The .NET Framework offers good variety of tools for working with strings, but care must be taken as there are several gotchas to trip up the beginner. The first thing to note about strings in .NET is that they are Reference Types. Reference types are live on the managed heap in .NET and so they are managed by the .NET Garbage Collector and unlike Value types they are not automatically destroyed when they are out of scope. Strings can b... (more)
category: Architecture | clicked: 27 | comment | | source: www.csharphelp.com
tags: String, C#, strings
4
Shouts

Strings Are Immutable!

published 714 days, 14 hours, 21 minutes ago posted by JudoJudo 716 days, 18 hours, 47 minutes ago
Saturday, June 11, 2011 9:57:06 AM GMT Thursday, June 09, 2011 5:31:03 AM GMT
Working with strings is a common task in most apps but there are several ‘gotchas’ that can arise due to the immutable nature of a String in .NET. Immutable simply means that once created it doesn’t change. This seems strange at first since the value of a string variable can indeed be altered (more)
category: Architecture | clicked: 36 | comment | | source: www.csharphelp.com
tags: String, C#, strings
5
Shouts

Maybe as an Extension Method

published 1056 days, 9 hours, 42 minutes ago posted by KodefuGuruKodefuGuru 1059 days, 10 hours, 12 minutes ago
Sunday, July 04, 2010 2:36:02 PM GMT Thursday, July 01, 2010 2:06:40 PM GMT
A frequent question I received concerning the Maybe static class was “why didn’t you make extension methods?” I am a proponent of extension methods, so it would seem that I would prefer “42”.ToInt32() over Maybe.ToInt32(“42”). However, I immediately created a static class for this despite my previous criticisms of helper classes. Why? Semantics What does it mean when someone writes Request.QueryString[“index”].ToInt32()? It’s not obvious that ToInt32() returns a Nullable (more)
category: How To | clicked: 0 | comment | | source: www.kodefuguru.com
tags: Extension Methods, Convert, String, extension method, Parsing
3
Shouts

C# 4.0-string.IsNullOrWhiteSpace()

posted by http://jalpesh.blogspot.com/http://jalpesh.blogspot.com/ 1161 days, 4 hours, 7 minutes ago
Sunday, March 21, 2010 8:10:55 PM GMT
We have already has string.IsNullOrEmpty() method to check whether the string is null or empty.Now with Microsoft.NET Framework 4.0 there is a new another method that is that is called string.IsNullOrWhiteSpace() which will also check whether string is having whitespaces or not with null and empty string.This method is help full where we can check string is having whitespace rather then its empty or null. It will return a true if a string is empty,null or its having whitespaces. Let’s create a simple ... (more)
category: Web Dev | clicked: 0 | comment | | source: jalpesh.blogspot.com
tags: asp.net 4.0 beta, String, ASP.NET 4, c#4.0
7
Shouts

Measure string size – the right way. - Yevgeni Frolov

published 1226 days, 11 hours, 23 minutes ago posted by yevgenifyevgenif 1228 days, 12 hours, 37 minutes ago
Friday, January 15, 2010 12:54:58 PM GMT Wednesday, January 13, 2010 11:41:24 AM GMT
Measure string size – the right way. Recently I needed to measure an exact size in memory for a string – asked a developer sitting next to me how would he do it. An answer was: “Take a string’s length multiply by 2(it’s a UTF-8 encoding) – you will get an exact size”. Well this answer was wrong… And the explanation is in a definition of UTF-8 encoding. Here is a quote from Wikipedia: UTF-8 (8-bitUCS/Unicode Transformation Format) is a variable-lengthcharacter encoding for Unicode. It is able to rep... (more)
category: Web Dev | clicked: 0 | comment | | source: blogs.microsoft.co.il
tags: String, Programming, C#
4
Shouts

Code clarity: String templates revisited

published 1238 days, 10 hours, 43 minutes ago posted by http://code-clarity.blogspot.com/http://code-clarity.blogspot.com/ 1240 days, 10 hours, 27 minutes ago
Sunday, January 03, 2010 1:34:59 PM GMT Friday, January 01, 2010 1:50:57 PM GMT
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 formatters such as in ASP.NET AJAX 4.0: {Id}, {Name}, {Login}. This placeholders reflects public properties or fields of an object. (more)
category: Web Dev | clicked: 0 | comment | | source: code-clarity.blogspot.com
tags: String, PlaceHolder, StringBuilder, AppendFormat, Templates, Format, ASP.NET