- 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
126 Views
In Swift, String interpolation is a great feature to create a new string by embedding the value of a variable, constant, function and literal directly in the given string literal. Or we can say that using string interpolation we can create a string by combining static text and dynamic values. ... Read More
Ankita Saini
221 Views
In Swift, a random string is a sequence of characters. It is generated by randomly selecting characters from a set of available characters, for example: “fbbKDvf”, “dvsWFVsvdv”, etc. So to create random strings Swift provides the following methods − Using randomElement() method Using UUID Method 1: Using ... Read More
Ankita Saini
241 Views
To remove the last specified character from the string Swift provide a pre-defined remove(at:) function. This function removes a character from the specified position or index. Input String = “Today is cloudy day” Character = “o” Output “Today is cludy day” Where character “o” appears two times ... Read More
Ankita Saini
1K+ Views
To convert the string into an array of characters Swift proved the following methods − Using Array() initialiser Using append() method Input String = “Cloudy day” Output Array = [“C”, “l”, “o”, “u”, “d”, “y”, “d”, “a”, “y”] Here we converted all the characters present in ... Read More
Ankita Saini
687 Views
Swift provides a method named as updateValue() method to update the value of the dictionary using a specified key. If the specified key does not exist, then this method will add that key along with its value in the dictionary. Syntax dict.updateValue(nvalue, forKey: nkey) Here, nvalue represents the new ... Read More
Ankita Saini
489 Views
Swift supports a sorted() method to sort all the elements present in the given dictionary. This method sorts the key-value pairs of the dictionary according to their keys. Syntax func sorted(by:) Here, the value of by parameters are − Greater than(>) − To sort the elements into descending ... Read More
Ankita Saini
664 Views
In Swift, insertion sort is a sorting technique in which the given array is virtually divided into two parts that are the sorted and the unsorted part. Then the array is searched sequentially, compares two elements from the unsorted part, and moves them into the right place in the sorted ... Read More
Ankita Saini
275 Views
In Swift, insertion sort is a sorting technique in which the given array is virtually divided into two parts that are the sorted and the unsorted part. Then the array is searched sequentially, compares two elements from the unsorted part, and moves them into the right place in the sorted ... Read More
Ankita Saini
83 Views
In Swift, convert the string into an array of characters based on the specified character using the split() function. The split() function splits the given string at the specified separator and returns the result in an array. Input String = “Today is cloudy day” Character = “y” Output [“toda”, ... Read More
Ankita Saini
349 Views
Swift supports a sorted() method to sort all the elements present in the given dictionary. This method sorts the key-value pairs of the dictionary according to the values. Syntax func sorted(by:) Here, the value of by parameters are − Greater than(>) − To sort the elements into descending ... Read More