bracketedStrings         package:DAVIDQuery         R Documentation

_E_x_t_r_a_c_t _b_r_a_c_k_e_t_e_d _s_u_b_s_t_r_i_n_g_s.

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

     Extract substrings that are bracketed by specified strings before
     and after.

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

     bracketedStrings(s, before, after, verbose=FALSE, addNames=FALSE, drop.na=TRUE, warn.if.gt.1=TRUE)

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

       s: Vector of strings to search. 

  before: String to the left of the desired substring within s. 

   after: String to the right of the desired substring within s. 

 verbose: If TRUE, print the starting and ending index (or indices) of
          the desired substring(s). 

addNames: If TRUE, and if 's' is a vector, set the 'names' attribute of
          the return value to 's'. 

 drop.na: If TRUE, remove empty strings from the return value. 

warn.if.gt.1: If TRUE, warn if a string has more than one pair of
          bracketed target strings. 

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

     For a single input string 's', the return value is the desired
     substring sandwiched between 'before' and 'after'. For a vector of
     inputs, list of outputs.

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

     Roger Day

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

     'DAVIDQuery'

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

      
     bracketedStrings("quickbrownfox", "quick", "fox")
     bracketedStrings(c("quickbrownfox", "quickredfox"), "quick", "fox", addNames=TRUE)
     bracketedStrings("quickbrownfoxANDquickredfox", "quick", "fox")
     bracketedStrings("quickbrownfoxANDquickredfox", "quick", "fox", warn.if.gt.1=FALSE)

