Hi, I've no idea if there is a function for doing it, but if not, the following seems to work
a = "this is a string" paste(rev(substring(a,1:nchar(a),1:nchar(a))),collapse="") Martyn -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Trafim Vanishek Sent: 14 July 2010 11:13 To: r-help@r-project.org Subject: [R] reverse string Dear all, Are there any functions in R to reverse the order of the string. smth like reverse("abc") to get "cba"? Thanks a lot. [[alternative HTML version deleted]] ______________________________________________ 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. ________________________________________________________________________ This e-mail has been scanned for all viruses by Star.\ _...{{dropped:12}} ______________________________________________ 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.