Revision: 1522
http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1522&view=rev
Author: warnes
Date: 2012-04-03 19:49:53 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Add startsWith() function.
Added Paths:
-----------
trunk/gdata/R/startsWith.R
Added: trunk/gdata/R/startsWith.R
===================================================================
--- trunk/gdata/R/startsWith.R (rev 0)
+++ trunk/gdata/R/startsWith.R 2012-04-03 19:49:53 UTC (rev 1522)
@@ -0,0 +1,5 @@
+startsWith <- function(str, pattern, trim=FALSE)
+ {
+ if(trim) str <- trim(str)
+ substr(str,start=1,stop=nchar(pattern))==pattern
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|