Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f string interpolator does not support %n (platform line separator) specifier #6725

Closed
scabug opened this issue Nov 26, 2012 · 2 comments
Closed

Comments

@scabug
Copy link

scabug commented Nov 26, 2012

{code}scala> val a = 1; val s =f"$a%s%n$a%s"
a: Int = 1
s: String = 1%n1{code}

The ScalaDoc for the f interpolator states, "All specifiers allowed in Java format strings are handled, and in the same way they are treated in Java," but when read in context, format specifiers are only supported when in a formatting position. It would be useful if %n was supported directly. As it stands, an additional call to .format() is needed to insert a platform specific line separator.

@scabug
Copy link
Author

scabug commented Nov 26, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6725?orig=1
Reporter: Michael Pilquist (mpilquist)
Affected Versions: 2.10.0-RC2

@scabug
Copy link
Author

scabug commented Mar 9, 2013

@xeno-by said:
scala/scala#2222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants