
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

462 Views
In Swift, a string is a sequence of characters that represent in between double quotes, for example: ”Learn Swift”, “tutorialspoint”, etc. But when you print the string double quotes were removed by the compiler and you will get Learn Swift, tutorialspoint in the output. So if you want to print double quotes in the output, then you have to place the backslash character or escape character(\) before the double quotes you want to print inside the given string. It tells the compiler that the character should be treated as a literal character, it is not part of string syntax. ... Read More

315 Views
In Swift, escape sequence characters are those characters who do not represent themselves when they are used inside a string. Instead, they tell the compiler to perform the specified task. They are non-printable characters. Swift supports the following escape sequence characters in the string − Escape Sequence Characters Description It is a newline character. It tells the compiler to move to the new line. \t It is known as the horizontal tab. It tells the compiler to leave the tab. \r It is known as carriage return. It tells ... Read More

905 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 randomElement() method Swift provides an inbuilt function named as randomElement() method. This function returns a random element from the given sequence or collection. Syntax func randomElement() It returns random elements. If the given collection is empty, then it will return nil. Algorithm Step 1 − Create a ... Read More

2K+ Views
In Swift, a substring is a small sequence of characters present in the large string, for example, “Car color is blue”, then “Car”, “color”, “is”, and “blue” are the substrings of the given string. Swift provides the following methods to check if the string contains the specified substring or not − Using range(of:) method Using contains() method Using Regex Method 1: Using range(of:) method The range(of:) method is used to find the range of the first occurrence of the given substring in the string. So using this method we can check if the given substring is present in ... Read More

1K+ Views
Text data manipulation and processing can benefit from using a Python program that will eliminate the last specified character from a string. This kind of application can be used to modify data by deleting particular characters, validate user input by removing incorrect characters, and clean up the text by removing unwanted characters. In Python, we have some string in-built functions like rstrip() that remove the last specified character from the string. The slicing technique is the easier way to remove the character from the end. Syntax The following syntax is used in the examples − len() The len() ... Read More

341 Views
Replacing characters in a string with specified characters is a common text-processing method with many different applications. There are some examples like Data transformation, text normalization, and data cleansing. In Python, we have some string in-built functions that can be used to convert a string into an array of characters based on the specified character. The group of characters to form a word is called a string. In this program, we need an empty string to store the new string in it. Syntax The following syntax is used in the examples − replace() The replace() is an inbuilt function ... Read More

1K+ Views
Python has inbuild functions like lstrip(), strip(), and rstrip() that can be used to remove the character from both sides. The term trim the string of characters means to remove the character from the given string. For example − Given string is ‘iiiiiiiiiiiBOXERiiiiiiiiii’ and the character ‘i’ from both sides. The final result becomes BOXER. Syntax The following syntax is used in the examples − strip() This is a predefined method used in Python to trim the character from both sides of the string. [1:] [:-1] [1:] − This represents the after-slicing on the left side to ... Read More

13K+ Views
In Python, we have some time built-in functions like strftime() and datetime.now() that can be used to find the time in AM/PM format. The format time in AM/PM format uses various applications such as user interface, report & document, data visualization, and event scheduling. We will speak the time of AM when timing between midnight 11:59:00 to 12 noon. In the same way, we can say that the time difference between 12 noon to 11:59:00 midnight is called PM. The abbreviation AM/PM is used to indicate the exact time. Syntax The following syntax is used in the example &miinus; strftime('%I:%M:%S ... Read More

9K+ Views
In this article, we will learn how to develop a Python program using append(), extend(), and list() that will convert the given string into an array of characters. In this program, the array of characters represents the group of individual characters that break from the string. Syntax The following syntax is used in the examples − append() This is a predefined method used in Python that adds the character from the end. extend() This method is used to break the characters from a string. list() The method converts the string into a list of individual characters. [*string_variable_name] ... Read More

7K+ Views
When we are creating a web service that allows users all over the world to book events, we might use this program to convert each user's local time to GMT before putting it in our database. This would make comparing and displaying event times easier for users in different time zones comparing and displaying event times easier for users in different time zones. In Python, we have some time built-in functions like timezone(), localize(), now(), and astimezone() that can be used to convert the local time into GMT. The local time represents the current time whereas GMT is defined by ... Read More