Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 3
    x starts with y if x.Substring(0,y.Length).Equals(y) if and only if y.Length > 0 Commented Nov 18, 2008 at 16:50
  • 8
    Yup, you could indeed explicitly exclude this case. It's a pretty inelegant definition though, isn't it? Commented Nov 18, 2008 at 17:10
  • 7
    True. It also requires them to be non-null, too... but I'd say both of these add to the accuracy while taking away from the spirit of the simple definition :) Commented Jan 15, 2009 at 14:16
  • 8
    Infinite occurrences of the empty string occur between every pair of characters. Commented Jun 11, 2010 at 21:47
  • 3
    Yeah, it's just like putting a zero before a number — It doesn't change the value yet it still exists. Commented Aug 10, 2010 at 18:47