Questions tagged [text]

Text is a sequence of printable characters.

Text is a sequence of printable characters.

Text can be unformatted (plain) or formatted (rich).

The most common character codes used for representing text are Unicode and ASCII:

  • ASCII is a character code and an encoding.
  • Unicode is a complex standard, with multiple encodings, the most common of which is UTF-8.
31743 questions
7328
votes
55 answers

How to find all files containing specific text (string) on Linux?

How do I find all files containing a specific string of text within their file contents? The following doesn't work. It seems to display every single file in the system. find / -type f -exec grep -H 'text-to-find-here' {} \;
Nathan
  • 73,987
  • 14
  • 40
  • 69
1048
votes
31 answers

Reading a plain text file in Java

It seems there are different ways to read and write data of files in Java. I want to read ASCII data from a file. What are the possible ways and their differences?
Tim the Enchanter
  • 10,837
  • 4
  • 21
  • 20
963
votes
13 answers

Difference between text and varchar (character varying)

What's the difference between the text data type and the character varying (varchar) data types? According to the documentation If character varying is used without length specifier, the type accepts strings of any size. The latter is a PostgreSQL…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
939
votes
20 answers

Limit text length to n lines using CSS

Is it possible to limit a text length to "n" lines using CSS (or cut it when overflows vertically). text-overflow: ellipsis; only works for 1 line text. original text: Ultrices natoque mus mattis, aliquam, cras in pellentesque tincidunt elit…
Peter
  • 5,138
  • 5
  • 29
  • 38
899
votes
9 answers

MySQL: Large VARCHAR vs. TEXT?

I've got a messages table in MySQL which records messages between users. Apart from the typical ids and message types (all integer types) I need to save the actual message text as either VARCHAR or TEXT. I'm setting a front-end limit of 3000…
Tom
  • 30,090
  • 27
  • 90
  • 124
888
votes
8 answers

Print string to text file

I'm using Python to open a text document: text_file = open("Output.txt", "w") text_file.write("Purchase Amount: " 'TotalAmount') text_file.close() I want to substitute the value of a string variable TotalAmount into the text document. Can someone…
The Woo
  • 17,809
  • 26
  • 57
  • 71
795
votes
15 answers

How to remove spaces from a string using JavaScript?

How to remove spaces in a string? For instance: Input: '/var/www/site/Brand new document.docx' Output: '/var/www/site/Brandnewdocument.docx'
Joseandro Luiz
  • 8,744
  • 4
  • 20
  • 20
625
votes
9 answers

How to wrap text in LaTeX tables?

I am creating a report using LaTeX, however, the cell data in the table is exceeding the width of the page. How can I wrap the text so that it falls into the next line within the same cell of the table? Is the solution somehow related to specifying…
Arnkrishn
  • 29,828
  • 40
  • 114
  • 128
623
votes
39 answers

How can I insert a line break into a component in React Native?

I want to insert a new line (like \r\n,
) in a Text component in React Native. If I have:
Hi~
this is a test message.
Then React Native renders Hi~ this is a test message. Is it possible render text to add a…
Curtis
  • 6,242
  • 2
  • 10
  • 8
605
votes
21 answers

Best way to convert text files between character sets?

What is the fastest, easiest tool or method to convert text files between character sets? Specifically, I need to convert from UTF-8 to ISO-8859-15 and vice versa. Everything goes: one-liners in your favorite scripting language, command-line tools…
Antti Kissaniemi
  • 18,944
  • 13
  • 54
  • 47
577
votes
19 answers

Android: combining text & image on a Button or ImageButton

I'm trying to have an image (as the background) on a button and add dynamically, depending on what's happening during run-time, some text above/over the image. If I use ImageButton I don't even have the possibility to add text. If I use Button I can…
znq
  • 44,613
  • 41
  • 116
  • 144
509
votes
22 answers

How do you change text to bold in Android?

How do you change text/font settings in an Android TextView? For example, how do you make the text bold?
nithin
  • 5,091
  • 2
  • 15
  • 3
473
votes
15 answers

How to print color in console using System.out.println?

How can I print color in console? I want to show data in colors when the processor sends data and in different colors when it receives data.
Taranath Datta
  • 4,745
  • 4
  • 16
  • 4
466
votes
22 answers

Android TextView Justify Text

How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)? I found a possible solution here, but it does not work (even if you change vertical-center to center_vertical, etc).
user130076
460
votes
2 answers

Difference between VARCHAR and TEXT in MySQL

When we create a table in MySQL with a VARCHAR column, we have to set the length for it. But for TEXT type we don't have to provide the length. What are the differences between VARCHAR and TEXT?
user3840485
  • 4,735
  • 3
  • 20
  • 22
1
2 3
99 100