On Thu, Nov 10, 2011 at 4:17 PM, Worik R <wor...@gmail.com> wrote:
> It seems obvious to me that the empty string "" is length 0.

You are using the wrong function to find the length of a character string.

length() returns the length of the object, and length of (non-NULL)
scalars is always 1. If you want the number of characters in a string,
use nchar():

> nchar("")
[1] 0

Peter

______________________________________________
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.

Reply via email to