Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

String split typo #10

Closed
durana opened this issue Jan 20, 2010 · 3 comments
Closed

String split typo #10

durana opened this issue Jan 20, 2010 · 3 comments

Comments

@durana
Copy link

durana commented Jan 20, 2010

I'm very new to Scala and I know next to nothing about the Memcache protocol, so forgive me if this is incorrect. At KestrelHandler.scala:156 there is

val options = name.split("/")

and I believe it should be

val options = name.split('/')

@qhoxie
Copy link
Contributor

qhoxie commented Jan 20, 2010

These should both behave the same. Did you see this cause a problem somewhere?

@durana
Copy link
Author

durana commented Jan 20, 2010

My mistake. I was working in the Scala interactive shell while reading through this code. I tried to split a string on "." and "blah.blah".split(".") does not appear to behave the same as "blah.blah".split('.'). I assumed it was the difference between "." being a String and '.' being a Char. I feel stupid now for not actually trying it with "/" before submitting this. ;)

@robey
Copy link
Contributor

robey commented Apr 7, 2010

ah, yeah, the string version is interpreted as a regex. (this API comes from java.) so "." means single-char wildcard in that context. :)

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants