Wk9_RegExp-4pp

Aregularexpressionakaregexorregexpis

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 





 [2]
"Lac
qui
Parle
County"






 [3]
"St
John
the
Bap0st
Parish"
 [4]
"Stone
County”
 >
test = cNames[3] 5
 10/18/12
 One
possible
solu0on
 Second
possible
solu0on
 > substring(test, 1, 2) [1] "St" > substring(test, 1, 2) == "St" [1] TRUE > newName = paste("St.", substring(test, 3, nchar(test)), sep ="") > substring(test, 1, 3) [1] "St " > substring(test, 1, 3) == "St " [1] TRUE > newName = paste("St. ", substring(test, 4, nchar(test)), sep ="") 
 Do
you
see
any
problems
with
this?
 
 Do
you
see
any
problems
with
this?
 The
Web
log
 Prac0ce
with

 paste(), substring(), nchar(), strsplit() 169.237.46.168
‐
‐
[26/Jan/2004:10:47:58
‐0800]

 "GET
/stat141/Winter04
HTTP/1.1"
301
328

 "hNp://anson.ucdavis.edu/courses/"

 "Mozilla/4.0
(compa0ble;
MSIE
...
View Full Document

This note was uploaded on 05/08/2013 for the course STAT 133 taught by Professor Staff during the Fall '08 term at Berkeley.

Ask a homework question - tutors are online