Multiline find & replace in Xcode - ios

I would like to replace
import Quick
import Nimble
with
import XCTest
Is it possible to do it in Xcode find and replace or I have to use Xcode regular expressions?
I have tried: import Quick\nimport Nimble but it doesn't work as expected

You can find for multiline text and replace it (cmd+opt+f) with new text. make sure to copy and paste multiline text as it is written on the Xcode file.

I don't know how you tried and failed. But I tried and it worked. Procedures as bellow:
First select and copy the lines you wanna replace.
Shift+Option+CMD+F to open Find navigator in Xcode, then CMD+V to paste the multiline text.
You can also choose a scope for search. Then input the new line.

THE FAST WAY:
You can simply copy both lines dragging with the mouse and the paste them on find textfield.
THE COOL LEEMUR'S WAY:
But also there is a great way to find expressions:
Press CMD + f
A find field will appear on the top of the editor.
At the right side of the find field there is a "+" sign
Press "+" will display a list of special characters
Its very useful, you can make something similar to regular expressions, mixing literal text with patterns
You can try to find the expression just in the current file writing it in the top find field. Or you can try to find the expression in the whole project using the Find Navigation tab on the left. As you will see the expression will appear there also.
Moreover if you want you can use an actual regular expression to find something if you press in the word "Contains" at the left of the "+" sign. It will show a list where you can select the option "Regular Expression"
If you want to find text select "Find" at the left of the editor. If you want to replace it, select "Replace" and a new field will appear below.
You can replace the text with another pattern, using some of the words that you used to find the text. If you double clic on "Word1" at the find field it will appear at the replace field.
In this example I'm changing the order of two words around MyText

Related

Why does copying multi-row text from Google Sheets to the Instagram caption box add a quote mark at the beginning and end of the text?

This may be the most niche question ever but let's try it anyway.
I have a Google Sheets spreadsheet that contains cells with multiple lines of text. Each line of text is separated by a soft break.
As shown below, when I copy the contents of a cell (row 2 in the screenshot) from the Google Sheets app to the Instagram caption box, a quote mark is added to the beginning and end of the caption.
If I copy the contents of a cell and that cell has only a single line of text (row 3 in the screenshot), no quote mark is added.
I am using an iPhone 11 running the latest version of iOS.
The extra quotes are added when there are special characters in the cell. In your scenario, the Line Feed characters are causing this. Definitely annoying.
There is a way around this – using Carriage Return characters, rather than Line Feeds to separate each line. For some reason these characters don’t cause the quotation marks to appear.
One thing you can do in your sheet is to create a helper cell that will take your text, and replace the line feeds with carriage returns (assuming your input text is in cell A2, add this formula to an empty cell):
=SUBSTITUTE(A2,char(10),char(13))
The output for this will look like it doesn’t contain linefeeds, but when you copy & paste from that cell, the linefeeds will be there in the pasted text, without the extra quotation marks.
The quotations are inserted by the target application when non-printable or otherwise incompatible characters appear in the copied text. There are several scenarios in which the quotes don't appear, and several in which they do.
For example in the MacOS Notes application, consider a cell containing either a vertical tab (appearing as a line break in a single cell with a Cmd-Enter on Mac or Cntl-Enter on Windows) or a newline character in a formula such as ="test"&char(10)&"test". When copied and pasted into a record in Notes, the text is copied as is (i.e., as expected). However when pasting into the Notes search box, the quotes appear, such as described in the question.
There appear to be 3 alternative ways to handle this issue:
Strip the non-printable characters with a formula
Using the CLEAN function, the characters will be stripped. This will produce oft undesirable results, but will eliminate the quotes. See the Wrapped in CLEAN column:
Paste elsewhere first
In the Notes example, one can paste the offending text into a Note (or presumably any text editor.) The offending quotes are omitted. The text can then be recopied and repasted without quotes. This will still collapse a line feed into a space:
Publish to Web and copy from there
Publishing a sheet with non-printable characters enables quoteless copy, like the previous option, but may be a preferable. See the test sheet
Copy from the Sample Text column. You can paste without quotes, but the line break is stripped and replaced with a space as above.
this is a common issue. the solution would be to paste your copy into fx bar instead of cell selection. this way you can skip the additional quotes
The easiest of the easiest solution is to copy straight from the cell. Mark the text within the cell instead of marking the whole cell and then copy.
its very easy guys
just follow as i say
step1: type letter in a cell
step2: select logo(A) with 4 dash(-) which is on top
step3: select cell
step4:turn on wrap text
problem solved
if you are using desktop
mac: alt/opttion+enter
windows: alt+enter
you can also select all cell at once then you can select format on menu bar and select text warping and then wrap(this is not recommended as it may destroy your table format)

How to add some text above the special Latex arrow `\hookrightarrow`?

I wanna add some text such as true:coin above the special Latex arrow \hookrightarrow.Any methods I tried is doesn't work.
I use Latex in the markdown editor in web browser.
Both
$$\hookrightarrow^{xxx}$$
and
$$\hookrightarrow[]{xxx}$$
isn't work.
I want the result is that the xxx is abolve the arrow \hookrightarrow.
I am sorry i get it.
Using $$\xhookrightarrow[]{true:coin}$$.It is useful.

execCommand("bold") when text is between symbols

I want to create a very simple markdown editor with contentEditable and execCommand. I can only find examples where you select a text and press a button to make the selected text bold (or other stuff). But I would like to be able to write **bold text** and that it automatically makes the text between ** bold. Same like the editor from stackoverflow, but I don't want the ** to be removed. They should still be there, but maybe in another style. I don't know how to do it. Do you do that with Regex or how?

Using GREP in TextWrangler to search all plaintext, or text outside angle brackets

I'm looking for a way to search any and all plaintext appearing outside of angle brackets, to replace it with blank so that only code appearing within angle brackets remains.
Does anyone know how to do this?
I assume the objective is to remove everything outside of the <tags> without affecting the <tags> themselves in an efficient way, inside TextWrangler. My solution is limited, in that it only matches text that is <tags>inside the tags<tags>. Which means that it will not remove any text that appears before or after the tags. i.e. Only text inside the tags gets removed. It is easy enough once this is done to select/delete the remaining text.
Assuming the file you want to edit is open.
Type: "command f" to open the find window.
Under "Find" enter (>.*?<)
Under "Replace" enter ><
I would post a picture, but I'm new so not allowed.
To see what will be replaced, click "Next".
To replace one occurrence at a time(slow), click "Replace & Find".
To replace all occurrences, click "Replace All"

How do you add a superscript character into a Powerbuilder textbox?

Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?
That kind of depends on how you define "textbox", but in general the only way to mix normal and superscript text is with a richtext control. In PB 11.5, you can even use richtext as a column style.
Good luck,
Terry.
Yes. For the text control, you must select a font that has superscript characters (Arial does).
Go into the Windows Character Map (usually in the start menu under Accessories->System Tools) and select your font.
Then go to the superscript character that you want to place in your text control. Click it and then click the Select button to place it down in the character map text box.
Then click the Copy button.
Now you can return to PowerBuilder and paste this value into the properties window text area.
As long as the same font is selected for the DataWindow control as was selected in the character map it should show as your superscript character.
This same techinque can be done to include any of the Wingding type characters as well.
We ended up using two separate text fields. It's a butt-ugly solution, but it works. The superscript field has a smaller font and is nudged a little higher up.
I think newer PB versions support superscripts.
Thanks for the help.
Glenn
If you go to the character map - when you select your character it will show the keys to enter this character on the bottom right of the window.
Example : in Arial font - the ® (registered) mark is Alt + 0174
To enter these, turn your numlock on, hold the alt key down, and type 0 1 7 & 4 then let up on the alt key. You have to use the number keys on the number pad to do this the ones on the top of the keyboard dont work.
You can then enter your characters directly or do something like this :
ls_key = '®'
Actually I stumbled across a simpler solution. I copied and pasted a portion of the text from a pdf into the text property of a datawindow text contol. The superscript character simply pasted in. So I'm guessing that Dougman's solution would work too.
Example:
"™Trademark used under..."
Note: I'm using PB 9.0.1
Thanks for all the help,
Glenn

Resources