Skip to content
Prev 261069 / 398502 Next

Applying "toupper" to only portions of text strings

On May 27, 2011, at 00:05 , Dennis Fisher wrote:

            
How are you going to get that extra d in there? >;-)
No, I think that is pretty much the plan. It's a one-liner, though:
fixed=T),function(x){paste(c(toupper(x[1]),x[-1]),collapse="|")})
[1] "AAAA"   "BBB|cc" "|ddd"  


OK, a _long_ one-liner...