Is this what you want:


> a<- "12345_mydata"
> sub("_.*", "", a)
[1] "12345"


On Mon, Aug 27, 2012 at 5:29 AM, Rantony <antony.akkara@ge.com> wrote:

> Hi,
>
> here im unable to run a string handle function called unpaste().
>
> for eg:- a<- "12345_mydata"
> Actually my requirement what is i need to get , only 12345.  Means that , i
> need the all letter as a word which is before of  first  " _ " - symbol of
> "a". i tried to do with unpaste, it says function not found.  After that i
> tried with "strsplit() ". it ran, but again i need to write another method
> to get again after spliting.
>
> Any other good method is there for this requirement ?
>
> - Thanks
> Antony.
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/String-Handling-for-Split-a-word-by-a-letter-tp4641397.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

	[[alternative HTML version deleted]]


