by looperhacks · 6y ago · 0 comments
text = """hello
world"""
will contain the intendation before world, while in Java: String text = """hello
world"""
will be equivalent to "hello\nworld". var text = """
hello
world""";
will not have any indentation, as the common indentation is stripped from all lines.I'm not sure you can really compare them. They're two different features with fairly different uses, it's just that one or two of those uses somewhat overlap.
The closing delimiter can, however, be on the same line as the final content (in order to suppress the trailing newline for instance).