- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Ankita Saini has Published 319 Articles

Ankita Saini
41 Views
In Swift, we can merge two or more integer arrays without using the library function. So Swift provides an addition assignment(+=) operator to merge two integer arrays. Using this operator we will merge two arrays and assign the result into a new array. Syntax newArray += array Here, newArray ... Read More

Ankita Saini
295 Views
To merge the content of two dictionaries Swift provides a pre-defined function named merging(_:uniqueKeysWith:). This function creates a new dictionary by merging the elements of two dictionaries. It also uses a combining closure to check the values for duplicate keys. Syntax func merging(otherDict){comClosure} This function takes two parameters ... Read More

Ankita Saini
436 Views
In Swift, we can iterate through each character of the string very easily. For the iteration, Swift provides the following methods − Using for-in loop Using forEach() function Using enumerated() function Method 1: Using for-in loop We can use a for-in loop for the iteration. It iterates through ... Read More

Ankita Saini
159 Views
Swift provides a function named insert() to insert a string into another string. The insert(at:) function adds a new character or string in the current string at the specified position. Input String = “Program to learn” New String = “Swift” Output String = Swift Program to learn” Here ... Read More

Ankita Saini
919 Views
A dictionary is a collection of key-value pairs. Which means keys and values are interrelated with each other. So using a value we can easily get single or multiple keys from the given dictionary. Algorithm Step 1 − Create a dictionary with key-value pairs. Step 2 − Then create ... Read More

Ankita Saini
253 Views
In Swift, the frequency of all the characters in a string means how much time a character repeats in the given string. For example, “Swift tutorial”, here “t” repeats 3 times in the given string, “i” repeat 2 times in the given string. So in this article, we are going ... Read More

Ankita Saini
352 Views
To delete the suffix substring from the given string first, we check if the given substring is present in the specified string or not using the inbuilt hasSuffix() function. Then find the index of the suffix substring using the inbuilt index() function and finally remove the suffix substring. Input String ... Read More

Ankita Saini
250 Views
To delete the prefix substring from the given string first, we check if the given substring is present in the specified string or not using the inbuilt hasPrefix() function. Then find the index of the prefix substring using the inbuilt index() function and finally remove the prefix substring. Input String ... Read More

Ankita Saini
217 Views
A dictionary is an unordered collection in which data is stored in the form of key-value pairs, where keys are the unique identifiers of any data type like string, integer, etc., that are connected with each value. In Swift, we are allowed to create an empty dictionary. An empty dictionary ... Read More

Ankita Saini
386 Views
In Swift, to count how many times a specified character occurs in the given string we create a function. It will increase the value of the counter by one whenever the specified character appears in the given string and then return the final count at the end of the given ... Read More