Browse by Topic

Popular

Latest

Latest Posts

Two string variables being compared with an equals sign, illustrating C# string equality checks.
C#

C# String Equals: Choosing the Right Comparison

Understand C# string equality with ==, Equals, and String.Compare, including ordinal vs. culture-sensitive behavior, null handling, and performance trade-offs.

String ComparisonC# EqualityStringComparisonOrdinal vs Culture
Diagram comparing C# string comparison methods with ordinal and culture-sensitive paths.
C#

C# String Comparison: Ordinal vs Culture

Learn how to compare strings in C#: choose between ordinal and culture-sensitive behavior, use == and Equals effectively, and apply StringComparison when you need explicit control.

StringComparisonOrdinal comparisonCulture-sensitive comparisonString.Equals
C# string case conversion illustration showing uppercase and lowercase letters with culture settings
C#

C# ToUpper and ToLower: String Case Conversion

c# toupper tolower: Learn how to use C# ToUpper and ToLower for string case conversion, including culture-sensitive and invariant overloads, with practical examples an...

C#String ManipulationToUpperToLower
Illustration comparing C# TrimStart and TrimEnd methods on a string with leading and trailing characters.
C#

C# TrimStart vs TrimEnd: When to Use Each

Compare C# TrimStart and TrimEnd: their overloads, behavior with whitespace and character sets, null handling, and practical examples for trimming one side of a string.

C#StringTrimStartTrimEnd
C# string trimming with spaces being removed from both ends of a text string, surrounded by code editor styling.
C#

C# Trim: Removing Whitespace and Characters

c# trim: Learn how to use C# Trim, TrimStart, and TrimEnd to remove whitespace and custom characters from strings, including performance and culture considerations.

string manipulationwhitespace removalC# methodsinput validation
C# code snippet showing LastIndexOf used to find the last dot in a file name.
C#

Find the Last Occurrence with C# LastIndexOf

c# lastindexof: Learn C# LastIndexOf syntax, overloads, and practical use cases to find the last occurrence of a character or substring in a string.

C# string manipulationIndexOfString search.NET
Diagram showing a magnifying glass over a string with highlighted index positions, representing the IndexOf method in C#.
C#

Using C# IndexOf Effectively

Learn how to use the IndexOf method in C# on strings and collections, including overloads, comparison rules, error handling, and practical tradeoffs.

string searchIndexOfC#substring
C# string prefix and suffix comparison with StartsWith and EndsWith methods
C#

C# String StartsWith and EndsWith Usage

c# startswith endswith: Learn how to use C# StartsWith and EndsWith methods for string prefix and suffix checks, including overloads, culture considerations, and perfo...

String MethodsC# ProgrammingString ComparisonText Processing
Illustration of a C# string being checked for a substring with case-insensitive comparison options.
C#

C# String Contains: Usage, Case-Insensitive Checks, and Performance

Learn how to use C# String.Contains, handle case sensitivity with StringComparison, and choose between ordinal and culture-sensitive comparisons.

String.ContainsStringComparisoncase-insensitiveC# string performance
Illustration of C# string.Join concatenating an array of strings with a comma separator
C#

C# String Join: Syntax, Overloads, and Practical Usage

Learn how to use string.Join in C# to concatenate arrays and collections, choose the right overload, handle null elements, and avoid common pitfalls.

C#String.JoinStringBuilderLINQ