Learn C# (C sharp) in FREE step-by-step lessons.
Module 11: Strings in C#
There are many functions for working with strings.
For instance, you can extract just part of a string, tell if one string is embedded inside another string, and replace one string with another.
Goals:
- Work with Strings;
- Understand Built-in functions;
- Validate input;
- Use Regular Expressions;
- Create Word Games
Objectives:
- Know the various built-in string functions;
- Apply string functions in creating word games;
- Use string functions to validate input data;
- Be able to create and use Regular Expressions for string validation.
Please study the material at each of the links below.
Microsoft Reference: Strings and String methods- String Functions: Examples of the most used string methods
- String Length: Length gives the number of ALL characters in the String
- String Substr: Substr extracts a portion of a string
- Names: Using String Functions: Split name into first and last
Escape Sequence: \ and @: Using the \ and @ with strings with special characters- Is string a valid Social Security Number?: A valid Social Security number has 9 digits
- Regular Expressions: A regular expression is a way to determine if a string matches a pattern.
- Regular Expressions for a sentence: A sentence must have letters of the alphabet and end with . ? or !
- Regular Expression for Robot: R2D2, C3P0?: Regex robotregx= new Regex(@"([A-Z][0-9]){2}");
- Regular Expression Drill: Test your understanding
Scramble Array Algorithm: Easy algorithm to scramble (shuffle) an array- Anagram Demo: An anagram is simply the letters of the word scrambled
- Anagrams: Details for creating the form
- Cryptogram Demo: A cryptogram shuffles the alphabet to create a code
Glossary for strings lesson
Full Glossary