Learn Swift programming

Welcome to this online Swift programming learning platform. Here you can learn Swift programming in an easy way.

How to trim whitespaces in a Swift string?

Developers often need to work with string while developing iOS apps or apps for any other Apple devices. One of the most frequent tasks to perform on a string is trimming whitespaces. To trim whitespace, there is trimmingCharacters() method in the Fo [...]

Split a string into an array of substrings in Swift

In this Swift tutorial, you are going to learn how to split a string into an array of substrings with the help of examples. To achieve this task, we will use the Swift split() method. This is an in-built method that can help us break a string into mu [...]

Replace matching characters of a String in Swift

In this Swift programming tutorial, you are going to learn how to replace each matching occurrence of the old character or substring in the string with the new character or substring. In Swift, we can use the replacingOccurrences(of:with:) method tha [...]

Case Insensitive Comparison of Two Strings in Swift

In this Swift programming tutorial, you will learn how to compare two Swift strings with case insensitivity. That means we are going to ignore the case sensitivity of strings for this comparison. For this case insensitive comparison of two Swift stri [...]

Convert a string to lowercase or uppercase in Swift

In this Swift programming tutorial, you are going to learn how to convert a string to lowercase or uppercase. In Swift, there are already in-built methods available that can help us to transform any string to lowercase or uppercase. One is the upperc [...]

Swift Array map() method

In this tutorial, you are going to learn about the Swift Array map() method with some easy-to-understand examples. In Swift, the map() method allows you to transform an array by applying the same operation to each array element using a specified tran [...]

Convert an array to comma separated string Swift

In this tutorial, you are going to learn how to convert an array to a comma-separated string in Swift. Here we will create a string from an array that contains all the elements of the array and each one is separated by a comma. For example, consider [...]

Check if an array is empty or not in Swift

In this Swift programming tutorial, you are going to learn how to check if a Swift array is empty or not with examples. In Swift, we can use the built-in isEmpty property to check out if our array is empty. Below is a simple example of using this pro [...]

Array remove() in Swift

In this Swift tutorial, you are going to learn about the Array remove() method with some simple examples. The Swift remove() method removes an element of an array at the given index. We have to provide the index as an argument for the method. Syntax [...]

Remove the last element from an array in Swift

In this tutorial, you will learn how to remove the last element from an array in Swift programming. In Swift, there are three built-in methods that can be used to remove the last element from an array. Both of these methods are able to perform the ta [...]

| Next Page »