How can I add dashes in Any field on input and on backspace should remove - keyup

How can we add the dashes between text and when remove text characters it should not stick in loop.
like 44251-4548453-5

Related

Is it possible to save the paragraph entered in the text area tag including the line breaks?

In the text area I'm typing the input as two paragraphs but it's returning the text as a single paragraph
This is the code and I want to return the input in two paragraphs exactly as I typed in there
but it's returning as a single paragraph

Indentation in html textarea with spaces doesn't work as expected

When i'm trying to add extra spaces to html textarea to make my text be indented and wrapped in a right way I need, textarea trims these spaces and wraps text in it's own way.
Lets assume that dot (.) is a space. In this case things go in a way, I want them. The line '....some.........texts........here' will be displayed in text area of size (cols: 13) with monospace font as:
here we have a string in text area of max 13 chars length. And the string indented with one tab that represented with 4 chars at the beginning. So there are additional dots at the end of the lines, to make next part of string be on the next line in text area. And it works.
But if I use spaces instead of these dots, so the initial line is:
' some texts here'
in the same text as before it will look like
So textarea trimmed additional spaces in all places where it wrapped the string. Is there any way to avoid it?
UPD: Looks like this topic is highlighted here.

Microsoft Word / Outlook trims leading space

I send SQL to interested parties via Outlook as HTML, with Word as the editor.
I like to format my SQL using spaces, rather than tabs.
When I paste the SQL into the editor, formatting is spot on.
But the 'sent' version removes leading spaces.
For example:
Select
*
From
Employees
becomes
Select
*
From
Employees
Is there an option to prevent this?
I didn't find solution but found workaround - to replace all (and only) leading spaces to Nonbreaking Spaces. No needs to replace all ever spaces, only leading ones. This way Outlook will not trim them automatically while sending email.
Before send an email need to
select the text, you want to keep leading spaces, and run Find and Replace (Ctrl+H)
put into Find what: "^p " (caret, p, space) or click at the bottom [Special] button and choose Paragraph Mark and just a space character
put into Replace with: "^p^s" (caret, p, caret, s) or click at the bottom [Special] button and choose Paragraph Mark and Nonbreaking Space
now press [Replace All] - it will replace leading spaces with Nonbreaking Spaces only in selected text, leaving all the rest text unchanged.
Result with leading spaces:
First without leading spaces
One leading space in this row
No leading spaces again
One leading space in this row
Two leading spaces here
One leading space in this row
No leading spaces again
One leading space in this row
Two leading spaces here
Two leading spaces here
One leading space in this row
Two leading spaces here
Two leading spaces here
Three leading spaces here
With leading nonbreaking spaces:
First without leading spaces
One leading space in this row
No leading spaces again
One leading space in this row
Two leading spaces here
One leading space in this row
No leading spaces again
One leading space in this row
Two leading spaces here
Two leading spaces here
One leading space in this row
Two leading spaces here
Two leading spaces here
Three leading spaces here
Brief: Send e-mail as Plain Text to preserve whitespace.
After spending faaaar too much time trying (and failing) to override HTML paragraph styles, override list styles/characters, and tweak AutoFormat settings in Outlook 2013, the fallback solution may be to send any e-mails for which it is important to preserve whitespace as Plain Text.
One can send an e-mail as Plain Text by:
Selecting the Format Text ribbon tab.
Selecting Plain Text within the Format group.

Display text as text blocks in JTextPane

I have a String of random characters without spaces with a length of 50.000-1.000.000.
I want to display the text in a JTextPane with spaces after each 10 characters:
FGHTYTREDE FRTYHTGCZV GTYHYHJHBF...
The user needs to be able to insert characters within the String.
Therefore I don't want to insert spaces into the String as it would take some time to update the text each time.
Instead is it possible to change the display settings of the JTextPane accordingly?
No. You will have to implement your own JComponent or JPanel to do this.

text input component

Is it possible to ignore white space between characters inside a text input field
let's say a user types in "bri an" instead of "brian.
Is there a way that white space is ignore and treated it as one word?
One of many ways is to use the TextField.restrict property. Simply prevent spaces from being typed into your textfield in the first place by doing this:
myTextField.restrict = "^ ";
The ^ means to disallow the following characters (in this case we are disallowing a space).
I put an example on wonderfl http://wonderfl.net/c/teOC