initialChar: Convert the first letter that occurs in a string to lower...

Description Usage Arguments Value Note Author(s) Examples

View source: R/initialChar.R

Description

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).

Usage

1
initialChar(txt, adm = "[:lower:]", err = "Not acceptable value")

Arguments

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

Value

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.

Note

This function is not case sensitive.

Author(s)

Mike K Smith mstoolkit@googlemail.com

Examples

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)

MSToolkit documentation built on May 2, 2019, 6:30 p.m.