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
179
votes
13 answers

Soft hyphen in HTML ( vs. ­)

How do you solve the problem with soft hyphens on your web pages? In a text there can be long words which you might want to line break with a hyphen. But you do not want the hyphen to show if the whole word is on the same line. According to comments…
Pontus
  • 2,769
  • 4
  • 20
  • 13
175
votes
34 answers

How do I duplicate a whole line in Emacs?

I saw this same question for VIM and it has been something that I myself wanted to know how to do for Emacs. In ReSharper I use CTRL-D for this action. What is the least number of commands to perform this in Emacs?
Ray
  • 187,153
  • 97
  • 222
  • 204
174
votes
4 answers

Who originally invented this type of syntax: -*- coding: utf-8 -*-

Python recognizes the following as instruction which defines file's encoding: # -*- coding: utf-8 -*- I definitely saw this kind of instructions before (-*- var: value -*-), so I assume Python did not invent them and is not the only one that uses…
hamstergene
  • 24,039
  • 5
  • 57
  • 72
172
votes
20 answers

How can I split a text into sentences?

I have a text file. I need to get a list of sentences. How can this be implemented? There are a lot of subtleties, such as a dot being used in abbreviations. My old regular expression works badly: re.compile('(\.…
Artyom
  • 2,863
  • 3
  • 20
  • 15
170
votes
11 answers

align text center with android

I know it sounds easy. I need to put a text in center, but when the text is too long it needs to go below, but still align in the center of my xml. Here's my code :
Tsunaze
  • 3,204
  • 7
  • 44
  • 81
167
votes
10 answers

Extracting text OpenCV

I am trying to find the bounding boxes of text in an image and am currently using this approach: // calculate the local variances of the grayscale image Mat t_mean, t_mean_2; Mat grayF; outImg_gray.convertTo(grayF, CV_32F); int winSize =…
Clip
  • 3,018
  • 8
  • 42
  • 77
156
votes
10 answers

Auto line-wrapping in SVG text

I would like to display a in SVG what would auto-line-wrap to the container the same way as HTML text fills
elements. Is there a way to do it? I don't want to position lines separately by using s.
tillda
  • 18,150
  • 16
  • 51
  • 70
152
votes
18 answers

Underlining text in UIButton

Can anyone suggest how to underline the title of a UIButton ? I have a UIButton of Custom type, and I want the Title to be underlined, but the Interface Builder does not provide any option to do so. In Interface Builder when you select the Font…
RVN
  • 4,157
  • 5
  • 32
  • 35
152
votes
5 answers

Text border using css (border around text)

Is there a way to integrate a border around text like the image below?
jho1086
  • 1,998
  • 2
  • 16
  • 25
151
votes
11 answers

How to scrape only visible webpage text with BeautifulSoup?

Basically, I want to use BeautifulSoup to grab strictly the visible text on a webpage. For instance, this webpage is my test case. And I mainly want to just get the body text (article) and maybe even a few tab names here and there. I have tried the…
user233864
  • 1,727
  • 2
  • 13
  • 12
150
votes
18 answers

How to split text without spaces into list of words

Input: "tableapplechairtablecupboard..." many words What would be an efficient algorithm to split such text to the list of words and get: Output: ["table", "apple", "chair", "table", ["cupboard", ["cup", "board"]], ...] First thing that cames to…
Sergey
  • 19,487
  • 13
  • 44
  • 68
146
votes
5 answers

How to `wget` a list of URLs in a text file?

Let's say I have a text file of hundreds of URLs in one location, e.g. http://url/file_to_download1.gz http://url/file_to_download2.gz http://url/file_to_download3.gz http://url/file_to_download4.gz http://url/file_to_download5.gz .... What is the…
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
146
votes
16 answers

Using 'diff' (or anything else) to get character-level diff between text files

I'd like to use 'diff' to get a both line difference between and character difference. For example, consider: File 1 abcde abc abcccd File 2 abcde ab abccc Using diff -u I get: @@ -1,3 +1,3 @@ abcde -abc -abcccd \ No newline at end of…
VitalyB
  • 12,397
  • 9
  • 72
  • 94
144
votes
8 answers

HTML: Changing colors of specific words in a string of text

I have the below message (slightly changed): "Enter the competition by January 30, 2011 and you could win up to $$$$ — including amazing summer trips!" I currently have:

Mitch
  • 1,441
  • 2
  • 9
  • 3
144
votes
4 answers

How do I append text to a file?

What is the easiest way to append text to a file in Linux? I had a look at this question, but the accepted answer uses an additional program (sed) I'm sure there should be an easier way with echo or similar.
Dchris
  • 2,867
  • 10
  • 42
  • 73