¡@

Home 

c# Programming Glossary: strings

Parse JSON in C#

http://stackoverflow.com/questions/1212344/parse-json-in-c-sharp

are a number of examples out there with simplified JSON strings. Being new to C# and .NET in general I've struggled to get a..

How can I decode HTML characters in C#?

http://stackoverflow.com/questions/122641/how-can-i-decode-html-characters-in-c

Is there anything in .NET that can convert them to plain strings c# share improve this question You can use HttpUtility.HtmlDecode..

TransactionScope automatically escalating to MSDTC on some machines?

http://stackoverflow.com/questions/1690892/transactionscope-automatically-escalating-to-msdtc-on-some-machines

not using different SQL servers nor different connection strings nor do we have nested secondary connections opening there should..

Why .NET String is immutable? [duplicate]

http://stackoverflow.com/questions/2365272/why-net-string-is-immutable

This question already has an answer here Why can't strings be mutable in Java and .NET 16 answers As we all know.. values is vital much easier to ensure correctness of strings are indeed commonly used as keys . Conceptually it can make..

Tips for optimizing C#/.NET programs [closed]

http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs

with your tip. For instance When concatenating many strings together use StringBuilder instead. See link at the bottom for.. for caveats on this. Use string.Compare to compare 2 strings instead of doing something like string1.ToLower string2.ToLower..

Why is lock(this) {…} bad?

http://stackoverflow.com/questions/251391/why-is-lockthis-bad

otherwise the lock is allowed. This is why it's bad to use strings as the keys in lock statements since they are immutable and.. ArgumentNullException subject You should avoid locking on strings since they are immutable. if Monitor.TryEnter person.Name 30..

How do you convert Byte Array to Hexadecimal String, and vice versa?

http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa

16 return bytes Edit you can improve performance for long strings by using a single pass parser like so public static byte StringToByteArray..

Is there any significant difference between using if/else and switch-case in C#?

http://stackoverflow.com/questions/395618/is-there-any-significant-difference-between-using-if-else-and-switch-case-in-c

It's obviously not practical to build jump tables for strings of arbitrary lengths so most often such switch will be compiled..

Case insensitive 'Contains(string)'

http://stackoverflow.com/questions/444798/case-insensitive-containsstring

version of 'i' is the unfamiliar character 'Ä°'. Thus the strings tin and TIN are the same word in English but different words.. summarise you can only answer the question 'are these two strings the same but in different cases' if you know what language the..

How to read a text file reversely with iterator in C#

http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp

are permitted summary Returns the enumerator reading strings backwards. If this method discovers that the returned stream..

Proper use of the IDisposable interface

http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

that _theList in the above code contained a million strings and you wanted to free that memory now rather than waiting for..

How would you count occurrences of a string within a string?

http://stackoverflow.com/questions/541954/how-would-you-count-occurrences-of-a-string-within-a-string

for so you can assume that... EDIT II Of course for strings where length 1 string haystack once upon a time string needle..

Retrieving Property name from lambda expression

http://stackoverflow.com/questions/671968/retrieving-property-name-from-lambda-expression

the property was a string. because not all properties are strings i had to use object but then it would return a unaryexpression..

Is there a reason for C#'s reuse of the variable in a foreach?

http://stackoverflow.com/questions/8898925/is-there-a-reason-for-cs-reuse-of-the-variable-in-a-foreach

to modified closure pitfall. For example foreach var s in strings query query.Where i i.Prop s access to modified closure Due.. loop cannot be used outside the loop foreach string s in strings var finalString s won't work you're outside the scope. So the..

Difference Between Equals and ==

http://stackoverflow.com/questions/971954/difference-between-equals-and

time types of a and b e.g. if they're both declared as strings then that overload will be called. That can behave how it wants..

Best practice to make a multi language application in C#/WinForms? [closed]

http://stackoverflow.com/questions/119568/best-practice-to-make-a-multi-language-application-in-c-winforms

language for example 'Lang.nl nl.resx' and fill it up with Strings. The IDE seems to generate a class for me automatically so in..

Using StringWriter for XML Serialization

http://stackoverflow.com/questions/1564718/using-stringwriter-for-xml-serialization

to a .NET string the encoding must be set to UTF 16. Strings are stored as UTF 16 internally so this is the only encoding..

Programmatically encrypting a config-file in .NET

http://stackoverflow.com/questions/21965/programmatically-encrypting-a-config-file-in-net

2.0 Applications 4GuysFromRolla.com Encrypt Connection Strings AppSettings and Web.Config in ASP.NET 2.0 Security Best Practices..

How do I sort a two-dimensional array in C#?

http://stackoverflow.com/questions/232395/how-do-i-sort-a-two-dimensional-array-in-c

dimensional array in C# I have a two dimensional array of Strings which make up my data table of rows and columns . I want to..

Comparing 2 objects and retrieve a list of fields with different values

http://stackoverflow.com/questions/3060382/comparing-2-objects-and-retrieve-a-list-of-fields-with-different-values

obj2.Address jk objective list String String containing 2 Strings LastName and Address I see reflection as the way to go but with..

Why are C# structs immutable?

http://stackoverflow.com/questions/3751911/why-are-c-sharp-structs-immutable

to make structs immutable. I like immutable classes too. Strings are immutable. What is the reason for making them immutable.. The string abc is the string abc it doesn't change. Strings should be immutable. The list 10 20 30 doesn't change. And so..

C# Equivalent of SQL Server 2005 DataTypes

http://stackoverflow.com/questions/425389/c-sharp-equivalent-of-sql-server-2005-datatypes

datetime2 smalldatetime datetime time Character Strings char varchar text Unicode Character Strings nchar nvarchar ntext.. time Character Strings char varchar text Unicode Character Strings nchar nvarchar ntext Binary Strings binary varbinary image Other.. text Unicode Character Strings nchar nvarchar ntext Binary Strings binary varbinary image Other Data Types cursor timestamp hierarchyid..

How to detect whether a character belongs to a Right To Left language?

http://stackoverflow.com/questions/4330951/how-to-detect-whether-a-character-belongs-to-a-right-to-left-language

X4 Note that these values are Unicode code points. Strings in C# .NET are UTF 16 encoded and need to be converted to Unicode..

format date in c#

http://stackoverflow.com/questions/501460/format-date-in-c-sharp

DateTime.ToString method Standard Date and Time Format Strings Custom Date and Time Format Strings Some additional related.. Date and Time Format Strings Custom Date and Time Format Strings Some additional related information If you want to display a..

AES Encryption in Java and Decryption in C#

http://stackoverflow.com/questions/5295110/aes-encryption-in-java-and-decryption-in-c-sharp

32 I strongly recommend you to use byte arrays instead of Strings for defining a cryptographic key. Update Another difference..

Merge msi and exe

http://stackoverflow.com/questions/535966/merge-msi-and-exe

UserQuietInstCmd UserQuietInstCmd SourceFiles SourceFiles Strings InstallPrompt DisplayLicense FinishMessage TargetName MySetup.exe..

In C#, why is String a reference type that behaves like a value type?

http://stackoverflow.com/questions/636932/in-c-why-is-string-a-reference-type-that-behaves-like-a-value-type

value type reference type share improve this question Strings aren't value types since they can be huge and need to be stored..

Encoding XPath Expressions with both single and double quotes

http://stackoverflow.com/questions/642125/encoding-xpath-expressions-with-both-single-and-double-quotes

Pizza then you have to use something like this Escaping Strings in XPath C to generate review @name Concat Fred's ' Fancy Pizza..

If strings are immutable in .NET, then why does Substring take O(n) time?

http://stackoverflow.com/questions/6742923/if-strings-are-immutable-in-net-then-why-does-substring-take-on-time

is called a persistent immutable data structure. Strings in .NET are immutable your question is essentially why are they..

Parse C# string to DateTime

http://stackoverflow.com/questions/7580809/parse-c-sharp-string-to-datetime

How many String objects will be created when using a plus sign?

http://stackoverflow.com/questions/9132338/how-many-string-objects-will-be-created-when-using-a-plus-sign

result RESULT Console.ReadKey In the case where Strings are concatenated in a loop or otherwise dynamically you end..