Posts from Swift

Count number of characters in a string in Swift

By Khushi Aswani

In this tutorial, we will discuss how to count the number of characters in a given string in Swift. This task comes under the chapter on strings which is proved to be one of the us.... Read More

String insert() in Swift

By Khushi Aswani

In this tutorial, we will discuss about insert() in Swift with its Syntax, implementation, and examples. String insert() is nothing but as the name suggests inserting a string at t.... Read More

Insert element to a specific index of an array in Swift

By Saruque Ahamed Mollick

In this Swift tutorial, I will show you how to insert an element to a specific position of an array in Swift. We will be using insert() function to add elements to an array. We wil.... Read More

Convert camel case to snake case in Swift

By Aakanksha Thakar

This tutorial will see how to convert the camel case to the snake case in Swift. First of all what are camel and snake cases? Camel and snake are the two styles of text. In the cam.... Read More

Check if a string is a valid number in Swift

By Saruque Ahamed Mollick

In this tutorial, we will learn how to check if a string contains only numbers or digits in Swift. I have created a Swift function that will return true if all the characters of th.... Read More

Remove last n occurrences of a substring in a string in Swift

By Aakanksha Thakar

This tutorial will see how to remove the last n occurrences of a substring in a string in Swift. The substring is part of the parent string. Algorithm Step 1: Import the foundation.... Read More

Fix Swift error: value of type ‘String’ has no member ‘components’

By Saruque Ahamed Mollick

In this tutorial, I will show you when error: value of type ‘String’ has no member ‘components’┬áthis error occurs and how to fix this error in Swift. Befor.... Read More

Remove last element from an array in Swift

By Aakanksha Thakar

This tutorial will see how to delete the last element from an array in Swift. Algorithm to remove last element from an array in Swift Check whether the array has any elements or no.... Read More

Related Posts