[R] substrings

Vladimir Eremeev wl2776 at gmail.com
Thu Aug 9 11:52:13 CEST 2007

one more, shorter, solution.
> a
[1] "a b c" "1 2 3" "q- 5" 

> gsub("\\s.+","",a)
[1] "a"  "1"  "q-"

Edna Bell wrote:
> I have a set of character results.  If one of the characters is a
> blank space, followed by other characters, I want to end at the blank
> space.
> I tried strsplit, but it picks up again after the blank.
> Any help would be much appreciated.

View this message in context: http://www.nabble.com/substrings-tf4241506.html#a12069488
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list