To copy or not to copy? When a function takes a string as a parameter, and returns a string, is that string the same as the input string, modified in place, or is it a modified copy of the input string? The D array convention is "copy-on-write". This means that if no modifications are done, the original string (or slices of it) can be returned. If any modifications are done, the returned string is a copy.
This is useful in cases where the user is expected to type in one of a known set of strings, and the program will helpfully autocomplete the string once sufficient characters have been entered that uniquely identify it.
produces the output:
fox => foxy food => food foxy => foxy foo => food
< 0 | s1 < s2 |
= 0 | s1 == s2 |
> 0 | s1 > s2 |
find, rfind are case sensitive; ifind, irfind are case insensitive.
< 0 | s1 < s2 |
= 0 | s1 == s2 |
> 0 | s1 > s2 |
find, rfind are case sensitive; ifind, irfind are case insensitive.
find, rfind are case sensitive; ifind, irfind are case insensitive.
Integer Whole Number: (for byte, ubyte, short, ushort, int, uint, long, and ulong) ['+'|'-']digit(s)[U|L|UL]
find, rfind are case sensitive; ifind, irfind are case insensitive.
The Soundex algorithm converts a word into 4 characters based on how the word sounds phonetically. The idea is that two spellings that sound alike will have the same Soundex value, which means that Soundex can be used for fuzzy matching of names.
Modifier | Description |
---|---|
c | Complement the list of characters in from[] |
d | Removes matching characters with no corresponding replacement in to[] |
s | Removes adjacent duplicates in the replaced characters |
The input text string s is formed into a paragraph by breaking it up into a sequence of lines, delineated by \n, such that the number of columns is not exceeded on each line. The last line is terminated with a \n.