Description Usage Arguments Value Note Author(s) Examples
By default, initialChar finds the first letter that occurs in a string and returns its lower case version. The user may use the "adm" argument to restrict the admissable letters which may be returned (by default this will be all possible lower case letters).
1 | initialChar(txt, adm = "[:lower:]", err = "Not acceptable value")
|
txt |
(Required) The string input to process |
adm |
(Optional) Regular expression which may be used to restrict the set of letters which will be returned. By default it will allow all lower case letters |
err |
(Optional) The error message which will be printed if no admissable letters (as determined by adm) are found. By default, message "Not acceptable value" will be displayed |
initalChar returns a lower case version of the first letter contained in the string "txt" if that character is admissable. If it is not (or no letter is found), an error message will be printed.
This function is not case sensitive.
Mike K Smith mstoolkit@googlemail.com
1 2 3 4 5 6 | initialChar("100 Kilometers")
## Not run:
# The first character is "A", but "a" is not in the list of admissable letters
initialChar("Allen, Alistair, Atticus", adm = "irt" )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.