Questions tagged [multiline]

Text that spans more than one line is considered "multiline". Concerns about wrapping, spacing, techniques and best practices.

Text that spans more than one line is considered "multiline". Concerns about wrapping, spacing, techniques and best practices, as well as language and platform-specific techniques for displaying text in a multiline format.

1916 questions
107
votes
10 answers

How to remove extra indentation of Python triple quoted multi-line strings?

I have a python editor where the user is entering a script or code, which is then put into a main method behind the scenes, while also having every line indented. The problem is that if a user has a multi line string, the indentation made to the…
Mike
103
votes
10 answers

Set UILabel line spacing

How can I modify the gap between lines (line spacing) in a multiline UILabel?
Matrix
  • 7,477
  • 14
  • 66
  • 97
101
votes
6 answers

How to Export a Multi-line Environment Variable in Bash/Terminal e.g: RSA Private Key

One of our Apps github-backup requires the use of an RSA Private Key as an Environment Variable. Simply attempting to export the key it in the terminal e.g: text export PRIVATE_KEY=-----BEGIN RSA PRIVATE…
nelsonic
  • 31,111
  • 21
  • 89
  • 120
100
votes
9 answers

Multiline Find & Replace in Visual Studio

Can it be done? We're using VS2005, VS2008, and VS2010. I don't mean regular expressions—which have their place—but plain old text find and replace. I know we can do it (at a pinch) with regular expressions using the \n tag, but we prefer not to get…
hawbsl
  • 15,313
  • 25
  • 73
  • 114
88
votes
7 answers

How to center a two-line text in a TextView on Android?

I want to let it looks like this: | two | | lines | Here is the current layout, not working at all.
shiami
  • 7,174
  • 16
  • 53
  • 68
88
votes
5 answers

How to get multiline input from the user

I want to write a program that gets multiple line input and work with it line by line. Why isn't there any function like raw_input in Python 3? input does not allow the user to put lines separated by newline (Enter). It prints back only the first…
MaciejPL
  • 1,017
  • 2
  • 9
  • 16
88
votes
20 answers

Specifying maxlength for multiline textbox

I'm trying to use asp: I want a way to specify the maxlength property, but apparently there's no way possible for a multiline textbox. I've been trying to use some…
Blerta
  • 2,170
  • 5
  • 23
  • 34
81
votes
3 answers

Bash: split long string argument to multiple lines?

Given a command that takes a single long string argument like: mycommand -arg1 "very long string which does not fit on the screen" is it possible to somehow split it in a way similar to how separate arguments can be split with \. I tried: mycommand…
ccpizza
  • 28,968
  • 18
  • 162
  • 169
81
votes
2 answers

Is there a way to put comments in multiline code?

This doesn't work: something = \ line_of_code * \ # Comment another_line_of_code * \ # Comment and_another_one * \ # Comment etc Neither does this: something = \ # Comment \ line_of_code * \ # Comment…
MarcinKonowalczyk
  • 2,577
  • 4
  • 20
  • 26
78
votes
7 answers

How to read mutliline input from stdin into variable and how to print one out in shell(sh,bash)?

What I want to do is the following: read in multiple line input from stdin into variable A make various operations on A pipe A without losing delimiter symbols (\n,\r,\t,etc) to another command The current problem is that, I can't read it in with…
kakas
75
votes
18 answers

Prevent enter key on EditText but still show the text as multi-line

How do I make an EditText on Android such that the user may not enter a multi-line text, but the display is still multi-line (i.e. there is word-wrap instead of the text going over to the right)? It's similar to the built-in SMS application where we…
Randy Sugianto 'Yuku'
  • 71,383
  • 57
  • 178
  • 228
75
votes
5 answers

How edit multiple lines on Xcode (shortcut)

I'm sorry, I don't find an already asked question for this problem... in Xcode, what is the shortcut to edit multiples lines like the "CMD+click" of sublime text?
Damien Romito
  • 9,801
  • 13
  • 66
  • 84
75
votes
13 answers

C++ Remove new line from multiline string

Whats the most efficient way of removing a 'newline' from a std::string?
shergill
  • 3,738
  • 10
  • 41
  • 50
74
votes
11 answers

Multiline Text in a WPF Button

How do I get multi-line text on a WPF Button using only C#? I have seen examples of using in XAML, but my buttons are created completely programmatically in C#. The number and labels on the buttons correspond to values in the domain…
Paul Gestwicki
  • 1,610
  • 1
  • 15
  • 18
63
votes
6 answers

Python multi-line with statement

What is a clean way to create a multi-line with in python? I want to open up several files inside a single with, but it's far enough to the right that I want it on multiple lines. Like this: class Dummy: def __enter__(self): pass def…
Justin
  • 24,288
  • 12
  • 92
  • 142