Learn it from developers who built it.
Tutorials, how-tos and deep dives on AI, .NET, C#, cloud and developer tools, written by the community.
Unlock the power of C# strings! This guide dives into immutability, memory management, common operations, and performance optimization for efficient coding. Master string handling!

Learn two efficient methods to reverse strings in C# using Array.Reverse() and loops. Understand the immutability of strings, performance considerations, and real-world applications. Master this fundamental C# skill!

Learn how to format strings in C# using String.Format and string interpolation. This guide covers format specifiers, alignment, numbers, dates, best practices, and real world examples.

Learn how C# Replace() and Trim() affect user-entered text, why strings are immutable, and how to preserve readable values while formatting HTML emails.

Understand the crucial differences between .NET's Replace() and Trim() methods for effective string manipulation. Avoid data integrity issues and formatting errors! Learn when to use each for optimal text cleaning in your applications. Master input sanitization!

Master string manipulation by counting vowels and consonants! This fundamental exercise strengthens your understanding of character operations, loops, and conditional statements, crucial for DSA success. Explore C, C++, and Java code examples with detailed explanations. Learn to handle case sensitivity and avoid common pitfalls. Build a solid foundation for tackling more complex string problems.

Learn how to implement Java's StringTokenizer in Python for parsing real-time cloud logs. This article explores Pythonic string tokenization techniques, including building a reusable StringTokenizer clone with custom delimiters, escape character handling, and stateful iteration. Discover best practices for performance and when a stateful tokenizer is superior to Python's built-in split() method, especially in high-volume data streams. Includes complete code and unit tests.

Learn how to effectively validate email addresses in C# using regular expressions (regex). This guide covers practical regex patterns, from simple checks to more robust RFC-like validation. Explore safer alternatives like System.Net.Mail.MailAddress and techniques for handling internationalized domains (IDN). Discover best practices for performance, security, and comprehensive email verification beyond just format, including unit testing and real-world examples.

Understand the crucial difference between string.IsNullOrEmpty and string.IsNullOrWhiteSpace in C#. This article clarifies when to use each method for effective string validation. Learn how IsNullOrWhiteSpace handles whitespace-only strings, preventing potential bugs. We also cover performance considerations, highlighting that while IsNullOrEmpty is slightly faster, the difference is often negligible in real-world applications. Choose the right tool for robust and reliable C# code.

Unlock the power of strings and dictionaries in Python! This guide covers essential string manipulation techniques, including indexing, slicing, methods like upper(), lower(), split(), and join(), and the versatile format() function.

Learn C# string manipulation methods for concatenation, searching, replacement, splitting, trimming, formatting, interpolation, and joining strings.

Learn how to count the occurrence of each character in a string using C#. This guide covers step-by-step instructions to efficiently analyze strings and determine the frequency of individual characters.

Learn three ways to remove duplicate characters from a C# string using LINQ, HashSet, and a simple array-based loop.

Compare String.Join with manual loops for concatenating strings in C#, including readability, performance, allocations, and maintainability.

String handling is a crucial aspect of programming, and C# provides multiple ways to manage strings effectively. This article compares verbatim string literals and raw string literals, highlighting their features, use cases, and differences.

A string in C# is an object belonging to the String class that symbolizes a string of characters. Numerous operations, including length, concatenation, comparison, obtaining substring, search, trim, replacement, and more, can be carried out on strings.

This article demonstrates several techniques to produce a string by modifying an existing string. You can examine the original string and the new, modified string when you run each example.

Efficiently compare strings in .NET considering globalization for culture-aware operations. Optimize performance by selecting appropriate StringComparison and CultureInfo options, ensuring accurate and efficient text processing in diverse linguistic environments.

Learn when to use String.IsNullOrEmpty() and String.IsNullOrWhiteSpace() in C#. Understand their differences for effective null and whitespace checks, enhancing data validation and code reliability.

Discover C# extensions simplifying Base64 string operations. Learn about Base64 encoding, its applications, and limitations. Explore the provided code samples for efficient usage in your projects.

Code examples of the most effective ways to concatenate strings in C#.

C# string interpolation is used to format and manipulate strings. This feature was introduced in C# 6. Using string interpolation, we can use objects and expressions as a part of the string interpolation operation.

Code examples of compare strings in C# using String.Equals, String.Compare, String.CompareTo() method, and StringComparer.

C# string is a common data type in C#. This tutorial teaches how to work with strings in C#.

Learn how to get a C# Substring from a string using String.Substring method in C#.

The Encoding.GetBytes() method converts a string into a byte array in C#. This article includes a code example of how to convert a C# string into a byte array.

C# StringBuilder is useful for concatenating multiple strings. The code examples demonstrate how to use a StringBuilder in C#.

Learn how to convert a C# List into a single string using a loop, String.Join, and LINQ Aggregate.

This article demonstrates how to pick a random string an array of strings.

Learn to convert a C# byte array to a string in C# and .NET Core. Code example included.
Everything on C# Strings, not only its articles: the C# Strings page →
Write an article and earn +1,000 SHARP when it is approved.
Write an article