hasChar              package:tkWidgets              R Documentation

_S_t_r_i_n_g _P_r_e_f_i_x _a_n_d _S_u_f_f_i_x _C_h_e_c_k_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     These functions return a _function_ for determining if a given
     prefix, suffix, or set of characters passed to this function
     exists in a character string passed to the returned function.

_U_s_a_g_e:

     hasChar(toCheck, what = "")
     hasPrefix(aPrefix)
     hasSuffix(aSuffix)

_A_r_g_u_m_e_n_t_s:

 aPrefix: character string to be used as the prefix to be checked for

 aSuffix: character string to be used as the suffix to be checked for

 toCheck: 'toCheck' a character string to be used to check to see if it
          exists in a character string passed to the returned function

    what: 'what' a character string defining whether toCheck will be
          used as a prefix (what = "prefix"), suffix (what = "suffix"),
          or a set of characters (what = "") to check the character
          string passed to the returned function

_D_e_t_a_i_l_s:

     The prefix (or suffix) is passed to 'hasPrefix' (or 'hasSuffix')
     and then the returned function can be used to check for the
     existence of that prefix (suffix) in a string passed to that
     function.

     hasChar is a more general function that determines the existence
     of prefix, sufix, or a set of a characters in a character string
     passed to the returned function.

_V_a_l_u_e:

     A *function* which itself returns a logical (of length 1)
     indicating if the prefix/suffix is found ('TRUE') or not.

_N_o_t_e:

     These function is part of the Bioconductor project at Dana-Farber
     Cancer Institute to provide Bioinformatics functionalities through
     R.

_A_u_t_h_o_r(_s):

     Jianhua (John) Zhang

_S_e_e _A_l_s_o:

     'pickFiles'

_E_x_a_m_p_l_e_s:

     # Function for checking for a prefix "xxx" :
     chkPfun <- hasChar("xxx", what = "prefix")
     # Function for checking for a suffix ".tex" :
     chkSfun <- hasChar(".tex", what = "suffix")

     chkPfun("xxx.tex")
     chkPfun(".xxx")
     chkSfun("xxx.tex")
     chkSfun("yyyyy")
     chkSfun("yxxx.text")

