I would like to print a tab space and also a hyper link in the description of a message embed.
Using \t along with three ` will print a tab space and [click](https://example.com) makes a hyper link.
However, I want to combine these to so I get <tab space> <hyperlink>
I have noticed that using 3 ` together with \t and [click](https://example.com) will print the tab space, but instead of printing the hyper link, it prints exactly like this <tabspce> [click](https://example.com)
Using a blank emoji instead of \t worked.
This is the emoji I used <:Blank:850603065760284722>
Related
I've been having a lot of trouble with multiline inputs in Selenium. From what I've learned on google, the \n character essentially enters a new line. That makes it such that I can't send a block multiline input as one paragraph text. I want to be able to replace the \n characters with a shift-enter (simultaneous) keystroke.
I've tried using different methods but none of them seem to work.
The string I'm trying to send is:
reply_messages = [
"FREE PILLOW - Thank you for your patience! \n To redeem your FREE pillow, just use the LINK IN OUR BIO and ADD TO CART - just cover shipping, no additional charges!"]
I eventually send the string with the line: reply_input.send_keys(reply_messages)
When I use selenium to input reply_messages, it outputs each of the lines as separate lines.
Essentially, it will send the first line, enter it into the chat window, then send the second line and enter it into the chat window, instead of entering the first line, adding a linebreak, entering the second line, and sending that entire spaced paragraph as one message.
I want to thus replace the linebreak with a shift-enter keystroke so that the browser doesn't register the newline as its own enter keystroke.
With the linebreak, the string is sent as two separate messages.
\n is an escape character which represents a line break. The keyboard keys you press to get that character don't have anything to do with your problem - Enter and Shift+Enter both add a \n to the chat text input box.
What does matter is how the chat window is programmed. When deciding if the button that was pressed means the message should be sent, the chat window isn't looking for text characters, it's looking for keyboard keys.
With Selenium you'll need to simulate the keyboard key presses, not the text that is filled into the text box. Check out this SO answer. As noted in that answer, you'll want to use something like Actions#keyDown or Actions#keyUp.
if I sets NSCenterTextAlignment for my NSTextView
my whitespaces at the end of string magically disappears
for example I have string
#"while "
if I display it with NSRightTextAlignment it shows well
|white |
but with NSLeftTextAlignment all whitespaces just cut
|white|
how can I get results like
| white|
tabs is not an option
Just a guess: it sounds as if you are trying to left-align centered items by using spaces to pad some of them. If you must do this you can use non-breaking spaces (UTF-16 0x00A0, type as option-space). HTH
I am parsing a csv file and the file has "\t" characters after every column. Why is it that when I print out the individual lines in terminal or open the file in my text editor that the tab spacing between each of the columns is different?
When you use tab, you're essentially moving to the next tab location, not moving over a specific distance. To see the difference, try using 4 spaces instead of tab. Or, alternatively, run the following code, and I think it may become clear to you.
puts "Hel\tlo world!"
puts "H\tello world!"
puts "Hell\to world!"
Hope that helps.
Do you mean something like
1 1
12345678 1
as a result of
puts "1\t1"
puts "12345678\t1"
A tab jumps to the next position in 8-space steps (8 spaces is a common distance, but it depends on settings of your editor. For ruby often is 2-space distance is used).
If the previous text is longer then 8 characters, then you jump to the next position and you have the impression of different tab spacing.
How to find and delete all the line breaks? I tried \n and it doesn't work! Regular expression? what kinda of expression?
I found the answer in the TextMate IRC channel.
Press Option Return to search for literal line breaks in the Find and Replace panel.
Searching for \n works if you select the "Regular Expression" option, but won't work in the literal search mode.
Without regex (regular search):
Alt + ⏎
Select the empty space in between the lines and Copy. Then Select the block of text you want to remove line breaks from. Go to Find & Replace. Paste the copied empty space in the Find field. Type a space in the Replace field. Hold Option, which toggles Replace All to In Selection, then click In Selection. This should do the trick.
Using TextMate on Mac, the "invisibles" can be displayed by using
View -> Show Invisibles
But the space vs tab characters are not shown, and Preferences doesn't seem to have any entry to change that either. Is there a way to show them? It is because some older coder may have tab or space mixed together so what looks good in the editor may actually be misaligned. (editor shows tab as 2 spaces)
Tab characters are shown, but spaces are not. What's probably happening is that you have Soft tabs turned on, in which case the tabs are converted into spaces automatically.
alt text http://grab.by/grabs/fabaea391dc8bc764636f0ca19a8c38d.png
In this picture there is a tab character, new line, tab character, new line, soft tab, new line
See this thread for an explanation as to why spaces are not shown.
Here is where you can change soft/real tabs.
alt text http://grab.by/grabs/783db3a88609a01c7702cbd250f495c6.png
If "Show invisibles" is activated, you will see a little triangle for each tab, which points to the right. Spaces are not shown at all, you can only see them indirectly, i.e. via the symbol which represents the line break. If the line break isn't the first character after your code of that line, there are spaces in between.
So to make a long answer short: You should already see tabs, however the symbols representing the invisibles are sometimes hard to see.