Manually entering number instead of text field in swift [duplicate] - swift

This question already has answers here:
Input from the keyboard in command line application
(20 answers)
Closed 4 years ago.
I want to print "Best Country" based on numbers in swift
for example : - if i enter " 1 " it will print "Best". if i enter " 2 " it
will print " Country ". For 1 and 2 it will print " Best Country ".
how to manually enter numbers in swift ?

As per the OP it seems a project with console input/output is desired. To input values from console. You need to create a console based project with swift selected as Language.
Xcode -> New -> Project...
then select appropriate option as in screenshot below :
Press Next and then fill in the required details (project Name etc...)

Related

Navigating word document with vbscript [duplicate]

This question already has an answer here:
How to use excel built-in constant in VBS [duplicate]
(1 answer)
Closed 4 months ago.
I want to open a word document and jumpt to page 5 with a vbscript. In vba the following works:
Set word_app = CreateObject("Word.Application")
set word_doc = word_app.documents.open(doc_path)
word_app.displayalerts = false
word_app.visible = true
word_doc.activate
word_doc.select
word_app.activewindow.selection.Goto wdGoToPage, wdGoToAbsolute, 5
but in the vbscript i just jump to page 7 (last page of doc) instead.
Instead of using the GoToItem and GoToDirection constants names, just use their number values: learn.microsoft.com/en-us/office/vba/api/word.wdgotoitem

How to find all occurrences of a word or a character and edit in visual studio code? [duplicate]

This question already has answers here:
Select multiple lines with cursors at each line start
(5 answers)
Closed 4 years ago.
How to find all occurrences of word or a character and select them once and edit using multi cursor in visual studio code?
I have list of users and need to add domain before names.
I have:
abc
pqr
xyz
I want :
domain\abc
domain\pqr
domain\xyz
I want to search for a new line character which will take me to the end of the each user name then by pressing home button I should reach to the beginning of each user where I will type "domain\" and it will modify each user at once.
I was able to do this in sublime text 3 by find all feature which provides multi cursor at each occurrence of character.
Is there any way to do the same in VS code ?
The easiest way to achieve this doesn't involve searching for newlines but rather by
Making a selection (Such as Ctrl+A)
Add cursor to all lines of the selection (Alt+Shift+I)
Pressing home (Home)
You can use search and replace with a simple regular expression.
Search for: ^(.+)$
Replace with: domain\\$1
Make sure to enable regular expressions (Alt+R).

How to tell VS Code format doc to wrap line after certain length? [duplicate]

This question already has answers here:
Automatically hard wrap lines at column in VSCode
(11 answers)
Closed 3 years ago.
In Visual Studio Code, when you press ALT SHIFT F to format HTML document, VS Code would wrap a line that is too long into multiple lines.
I think VS Code let the line grow too long before wrapping. Is there a setting in VS Code to tell it to wrap after certain line length?
This question is NOT a duplicate of the hard wrap question. This is about wrapping during format document process.
Open user settings: File - Preferences - Settings
Then add/edit this item:
"html.format.wrapLineLength": 80
FYI the new settings are in effect after you save the changes.
If you are formatting HTML and are annoyed that VScode formats your long lines into multiple lines, go to:
File > Preferences > Settings
Search for:
HTML › Format: Wrap Line Length
and set it to 0

Auto close end tag by typing ' </ ' in Sublime Text 2 [duplicate]

This question already has answers here:
Short cut for close HTML tag in Sublime Text 2
(6 answers)
Closed 1 year ago.
Sublime Text 2 has a default key binding to close an elements end tag automatically by typing (Alt + .)
For example,
<h1> + (Alt + .), produces <h1></h1>
Default keybindings are accessible through Package Controller,
{ "keys": ["alt+."], "command": "close_tag" }
However, I'm not sure how to write it for </, as this would be two keys pressed consecutively as appose to two keys pressed at the same time.
How can I rewrite the key binding to use </?
Any insight would be helpful. Thanks!
Check in your preferences file if the following line exists
"auto_close_tags": true,
It works for me in Sublime Text 3.

iPhone - How can I right align PSTextFieldSpecifier of settings bundle

I've settings bundle in my iPhone application. How can I right align the PSTextFieldSpecifier value?
This worked for me. If you open the property list (Root.plist) file as a source and paste the following for each entry you want right-aligned:
<key>IASKTextAlignment</key>
<string>IASKUITextAlignmentCenter</string>
Have the same desire. What I currently do is to put some space bars after my title. So I have to text fields in my settings, Account and Password:
Account TheName
Password *****
now I would count the chars that I need to get the same length of both strings. In this case the "Account" label has one char less then the "Password" label. So I would put the remaining characters count twice and append them to the label. In this case the label would be "Account " (2x " ")
following I will replace the " " with "_" so that you can see the difference
Account__ TheName
Password *****
It looks different sized in your XCode Settings Bundle but on the device or in Simulator it will be fine