Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:41:21+00:00 2026-05-26T19:41:21+00:00

While using IntelliJ Idea to code Scala I’ve noticed it to use to offer

  • 0

While using IntelliJ Idea to code Scala I’ve noticed it to use to offer to enclose a string literal in a second pair of double quotes. «Convert to “””string”””» – it says. If I agree – it just adds a 2 more double quote marks before and 2 more after the string, having my string to look like

val myString = """my string value"""

How does this make any sense? Do triple double quotes mean something special in Scala?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:41:22+00:00Added an answer on May 26, 2026 at 7:41 pm

    With IntelliJ smart String, there should be only two cases.

    • simple string (which you can convert to triple double-quotes multi-line String literal)
    • multi-line String literal, introduced way back in Scala 2.1.7 (which you can convert back to a single String)

    So when you see this:

    convert to multi-line String literal

    you should end up with """. If not, this should be reported as a bug in the youtrack Scala project.


    But if there were triple double quotes, then IntelliJ correctly transformed your simple String into a multi-line String literal, which, as illustrated by langref, allows you to define:

    val text = "This\nIs\nA\nMultiline\nString"
    

    into

    val text = """This
    Is
    A
    Multiline
    String"""
    

    Rosetta code mentions the behavior has changed between Scala 2.7 and 2.8:

    on version 2.7, the triple-double-quoted string ends at the third consecutive quote, on version 2.8 it ends on the last quote of a series of at least three double-quotes.

    Scala 2.7:

    scala> val error = """can't finish with a quote: """"
    <console>:1: error: unterminated string
           val error = """can't finish with a quote: """"
                                                        ^
    

    Scala 2.8

    scala> val success = """but it can on 2.8: """"
    success: java.lang.String = but it can on 2.8: "
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using IntelliJ Idea 10 IDE for my grails development and while it's great
While using the vector why do we sometime use the operator[] like homework[mid] but
While using this code to serialize an object: public object Clone() { var serializer
I'm making an iPhone game in .lua using IntelliJ IDEA, and I have a
While using jCart I noticed that it did not work on the iPhone. After
I'm using IntelliJ Idea 8.1.2 for Grails development. The dynamic nature of Groovy is
While using keyword ref , calling code needs to initialize passed arguments, but with
While using the repository module I noticed Attribute and Values in module setting. What
While using tar->write() I am getting errors while using complex file names. The code
I'm currently using IntelliJ IDEA for Java development, but I'm also interested in answers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.