Questions tagged [multilinestring]

236 questions
1935
votes
30 answers

How do I split the definition of a long string over multiple lines?

I have a very long query. I would like to split it in several lines in Python. A way to do it in JavaScript would be using several sentences and joining them with a + operator (I know, maybe it's not the most efficient way to do it, but I'm not…
Pablo Mescher
  • 26,057
  • 6
  • 30
  • 33
222
votes
6 answers

Paste a multi-line Java String in Eclipse

Unfortunately, Java has no syntax for multi-line string literals. No problem if the IDE makes it easy to work with constructs like String x = "CREATE TABLE TEST ( \n" + "A INTEGER NOT NULL PRIMARY KEY, \n" ... What is…
Thilo
  • 257,207
  • 101
  • 511
  • 656
114
votes
8 answers

C#: Looping through lines of multiline string

What is a good way to loop through each line of a multiline string without using much more memory (for example without splitting it into an array)?
flamey
  • 2,311
  • 4
  • 33
  • 40
46
votes
10 answers

Notepad++ newline in regex

Suppose you have this file: x a b c x x a b c x x and you want to find the sequence abc (and select the whole 3 lines) with Notepad++ . How to express the newline in regex, please?
theSpyCry
  • 12,073
  • 28
  • 96
  • 152
37
votes
7 answers

what's the best way to hardcode a multiple-line string?

In unit test I would like to hard code a block of lines as a string. In C# I would do var sb = new StringBuilder(); sb.AppendLine("myline1"); sb.AppendLine("myline2"); sb.AppendLine("myline3"); Since I converted to F# I tried to minimize the usage…
colinfang
  • 20,909
  • 19
  • 90
  • 173
25
votes
2 answers

Kotlin add carriage return into multiline string

In Kotlin, when I build a multiline string like this: value expected = """ |digraph Test { |${'\t'}Empty1; |${'\t'}Empty2; |} |""".trimMargin() I see that the string…
Tom Tresansky
  • 19,364
  • 17
  • 93
  • 129
21
votes
4 answers

Multiline strings with no indent

How do you have a multiline string with no leading spaces and still be properly aligned with method? Here are some of my attempts. The one that is working is not very fun... module Something def welcome " Hello This is an example. I have to…
binarymason
  • 1,351
  • 1
  • 14
  • 31
19
votes
4 answers

Java 7 - Multiline strings

I've read that multiline string literals were proposed to be added in Java 7. Although I can't find any documentation saying definitely that they have been. I'd like to know if they are, because this is something I'd consider switching versions…
Mike
  • 58,961
  • 76
  • 175
  • 221
13
votes
3 answers

How to convert a GEOS MultiLineString to Polygon?

I am developing a GeoDjango application where users can upload map files and do some basic mapping operations like querying features inside polygons. I recognized that users happen to upload "MultiLineString"s instead of "Polygon"s sometimes. This…
onurmatik
  • 5,105
  • 7
  • 42
  • 67
11
votes
1 answer

Is there an operator that can trim indentation in multi-line string?

This is really nice in Groovy: println '''First line, second line, last line''' Multi-line strings. I have seen in some languages tools that take a step further and can remove the indentation of line 2 and so, so that…
Binders Lachel
  • 505
  • 1
  • 5
  • 14
7
votes
2 answers

How can I split / clip a polygon by lines in R?

I want to separate CO (a polygon) into sections (also polygons) that are not split by roads (linestrings). Which is to say I want the sections of smaller polygons to be bounded by roads or state borders, and not to contain any roads that enter and…
Sam Koss
  • 141
  • 5
7
votes
1 answer

YAML multi-line strings: keys vs array values

This is very specific but left me stumped. We treat nested keys + regular arrays almost the same on parsing – sometimes adding extra info when needed, like this: --- Entry 1: - lorem: true - ipsum - dolor Entry 2: - lorem …
Paracetamol
  • 320
  • 3
  • 19
7
votes
0 answers

Python ttk Treeview - item's text with newline are cropped

I have a problem with ttk.Treeview in Python 3. If I try to insert item with values that contain newline, treeview crops item and shows only first line of text, instead of making multiline item. Is there any possibility to somehow configure treeview…
voldi
  • 423
  • 2
  • 4
  • 10
6
votes
4 answers

Could not find module (or one of its dependencies). Try using the full path with constructor syntax

When I run the command: from shapely.geometry import LineString I get this error: Could not find module 'C:\Users\SWWB\Anaconda\Library\bin\geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax. How can I solve…
Roger
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

How to truncate tail each line of multiline UILabel

NSString *longStr = @"AAAAAAAAAA\nBBBBB\nCCCCCCCCCCCCCCCCCC"; How to make this truncation with UILabel for some label width: AAA... BBB... CCC...
Valerii Pavlov
  • 1,986
  • 1
  • 19
  • 30
1
2 3
15 16