- 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
212 Views
In this article, we will learn how to write a swift program to convert an array into a string and join elements with a specified character. An array is used to store elements of same data type in an order. Here we use the following methods to join elements of ... Read More
Ankita Saini
235 Views
Swift has various functions like flatmap(), compactmap(), reduce() to flatten an 1D array. An array is used to store elements of same data type in an order whereas a set is used to store distinct elements of same data type without any definite order. Method 1: Using flatmap() Function To ... Read More
Ankita Saini
557 Views
In swift, we have various methods like Array() initializer and for-in loop that can be used for getting the subarray from an array using a specified range of indices. An array stores elements of the same data type in an order. Let’s understand both the methods in detail in this ... Read More
Ankita Saini
102 Views
A collection is a group of elements or objects that are gathered together for some specific tasks. Swift supports three types of collections: Array, Set, and Dictionary. They are implemented as generic collections, also they are clear about what type of values they can store which means you can not ... Read More
Ankita Saini
639 Views
In Swift, we are allowed to replace whitespaces with the specified character like $, *, ! etc. So, to replace the spaces of a string with a specific character swift provide the following methods − Using replacingOccurrences() method Using user-defined method Using components() and joined() methods Using split() and ... Read More
Ankita Saini
607 Views
A stack is a data structure which works on LIFO(last in first out) principle. It is used to store and manage data where the recently added item is the first one to be removed from the stack. Stack support the following operations − Push − It is used to ... Read More
Ankita Saini
560 Views
In Swift, sorting of a string means arranging the characters of the string in the specified order either in ascending or descending order. For example − Input: String = "color of the bird is pink" Output:" bcdefhiiiklnoooprrst" Here, the resultant string is sorted in ... Read More
Ankita Saini
159 Views
In Swift, we can adjust the size of the string by trimming some specified number of characters from both sides of the string. Or we can also trim the extra whitespaces which we do not want from both sides of the original string using the following methods. Method 1: Trim ... Read More
Ankita Saini
94 Views
In Swift, we can adjust the size of the string by trimming some specified number of characters from the left side of the string. Or we can also trim the extra whitespaces which we do not want on the left side of the original string using the following methods. Method ... Read More
Ankita Saini
89 Views
In Swift, we can adjust the size of the string by trimming some specified number of characters from the right-hand side of the given string. Or we can also trim the extra whitespaces which we do not want on the right-hand side of the given string using the following methods ... Read More