Smart Strings

String Literals just got a little smarter!

You can now convert a normal strings to multiline (with triple quotes) string.  Notice how the special characters are escaped. (SCL-2991)

Screen shot 2011-04-28 at 10.52.12 PM.png

Screen shot 2011-04-28 at 10.52.18 PM.png

And back again:

Screen shot 2011-04-28 at 10.52.28 PM.png

Screen shot 2011-04-28 at 10.52.36 PM.png

Similarly, when you paste some text into a normal string (for example: C:\path\file.txt), the appropriate escaping is added. (SCL-3144)

Finally, you can now autocomplete, navigate, and rename-refactor references to classpath resources in string literals. (SCL-3138)

Screen shot 2011-04-28 at 8.22.38 AM.png

These features require a nightly build of the plugin, with the latest EAP build of IDEA 10.5.

Comments below can no longer be edited.

2 Responses to Smart Strings

  1. Avatar

    Alexander Temerev says:

    April 30, 2011

    Hi, Jason. Nice work. 🙂

  2. Avatar

    Nello says:

    December 22, 2011

    Intellij’s handling of quotation marks is already so stupid, this is another amazing dog’s breakfast of crap. Leave my quotation marks alone!

Discover more