Class Word
A replacement for the string class that supports multi-character letters. Each letter is a string.
Instances of this class are immutable.
Words can be constructed from strings using the relevant Alphabet.CreateWord.
The method Alphabet.Compare can be used to compare strings.
[Version(1, 1, 0)]
public sealed class Word : ICloneable, IEquatable<Word>, IEnumerable<string>, IEnumerable
- Inheritance
-
Word
- Implements
- Inherited Members
Constructors
- Word()
Constructs a new empty Word.
- Word(IEnumerable<string>)
Constructs a new Word from the given list of letters.
- Word(string)
Constructs a new Mstring with a single letter.
Fields
- Empty
A constant that denotes a string without any letters.
Properties
- this[int]
Returns the letter at teh specified index.
- Length
Returns the length of the word (the number of letters).
Methods
- Clone()
Returns a reference to this instance of String.
- Concat(Word, Word)
Concatenates four specified instances of String.
- Concat(Word, Word, Word)
Concatenates four specified instances of String.
- Concat(Word, Word, Word, Word)
Concatenates four specified instances of String.
- Concat(Word[])
Concatenates the elements of a specified String array.
- Copy(string)
Creates a new instance of Word with the same value as a specified word.
- EndsWith(Word)
Determines whether the end of this word instance matches the specified word.
- IndexOf(Word)
Returns the index of the first occurance of the given letter. If the letter is not present in the word, -1 is returned.
- IndexOf(string)
Returns the index of the first occurance of the given letter. If the letter is not present in the word, -1 is returned.
- Insert(int, Word)
Returns a new Word in which a specified word is inserted at a specified index position in this instance.
- IsNullOrEmpty(Word)
Indicates whether the specified word is null or an Empty word.
- Range(int, int)
Returns the word from the start ondex up to just before the end index.
- Remove(int)
Returns a new word in which all the letters in the current instance, beginning at a specified position and continuing through the last position, have been deleted.
- Remove(int, int)
Returns a new word in which a specified number of letters in the current instance beginning at a specified position have been deleted.
- Replace(Word, Word)
Returns a new string in which all occurrences of a specified word in the current instance are replaced with another specified word.
- Replace(string, string)
Returns a new string in which all occurrences of a specified letter in this instance are replaced with another specified letter.
- StartsWith(Word)
Determines whether the start of this word instance matches the specified word.
- Substring(int)
Retrieves a subword from this instance. The subword starts at a specified letter position and continues to the end of the string.
- Substring(int, int)
Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.
- ToLower()
Converts each letter in this word to lowercase.
- ToString()
Gives a string representation of this word.
- ToUpper()
Converts each letter in this word to uppercase.
Operators
- operator +(Word, Word)
Makes a new word that consist of the first word followed by the second word.
- operator ==(Word, Word)
Compares two words. Words are equal when they are the same length, and letters at corresponding letters are equal.
- implicit operator string(Word)
Implicitly converts a Word to a string. The result is a concatenation of the strings that represents each letter.
- operator !=(Word, Word)
Returns whether two wirds are not equal.