Swift program to convert a string to float and double. We can use floatValue, Float constructor, doubleValue or Double constructor to convert a string to float or double in swift.
ReadSwift program to return multiple values from a function. We can return multiple normal values or multiple optional values from a function.
ReadSwift program to insert characters to a string. This post will show you how to insert single or multiple characters to a swift string.
ReadSwift program to find the first and last character of a string in swift in two different ways. We can use first, last properties or startIndex, endIndex to find the first and last character of a swift string.
ReadSwift program to find the maximum or largest element in an array. We can use max or max(by) to find the largest array value. In this post, I will show you how to use max and max(by) with examples.
ReadSwift program to convert a string to date. We can use a DateFormatter class to convert a valid string to a Date object in Swift. We can use define different formats in the DateFormatter class.
ReadThis post will show you how to iterate through the key-value pairs of a swift dictionary. We will do it by using a for-in loop, using forEach and by using enumerated.
ReadString prefix methods in swift. Learn how to use string prefix swift method with example.
ReadThis post will show you how to check if two strings are equal or not in swift. We will learn ==, elementsEqual method and case insensitive comparison of two strings in swift.
ReadSwift string interpolation tutorial with example. Interpolation is the process to insert variables, constants, expressions, and literals into a string.
Read