Category: Strings
How to Add new keys to a Dictionary in Python?
In this tutorial, we will discuss different ways to add new keys to a dictionary in python. Table Of Contents Add new keys to a dictionary using [] Add Keys to Dictionary with None as Value Add Keys to Dictionary with proper values Add new keys to a Dictionary using the update() method Add new …
Check if String Contains Specific Characters in Python
In this article, we will learn how to check a string for specific characters in Python. Table Of Contents Method 1: Using in operator Method 2: Using contains() method Method 2: Using find() method Summary Method 1: Using in operator We can use the in operator to check if a particular character exists in a …
Check if String Contains Specific Characters in PythonRead More
Get first letter of every word in String in Python
In this article, we will discuss how to get first letter of every word in String in Python. Table Of Contents Introduction Method 1: Using For Loop Method 2: Using List Comprehension Summary Introduction Suppose we have a string, like this, Advertisements “This is a big string to test.” We want to create a list, …
Slicing in Python – Explained with examples
In this article, we will learn about slicing in Python Programming Language. Slicing is used to cut a part of string. Characters can be cut from the beginning or from end, also from a given index number. Table Of Contents What is an Index Number? Slicing in Python using Slice() function Slicing in Python using …
Strings in Python
A String in Python is a sequence of characters like, strValue = “sample” or strValue = ‘Sample’ Strings in python can be surrounded by either single quote marks like ‘text’ or by double quote marks “text”. We can also access individual characters in a string. We have curated a list of tutorials to explain all …
JavaScript: Convert ASCII Code to Characters
While working with javascript strings and characters, we may encounter a requirement to convert the ASCII value to specific characters. This article demonstrates easy ways to covert the ASCII code to their respective characters using different methods and various example illustrations. ASCII codes are the numeric value given to the characters and symbols for storing …
Javascript: Remove First and Last Character from String
This article will remove leading and trailing characters from a javascript string using different methods and example illustrations. While developing in any language, removing the first and last characters from the string is common before processing it, as it might be an address or URL. We will discuss both cases: if the character is known …
Javascript: Remove First and Last Character from StringRead More
Javascript: Remove Parenthesis from String
This article will remove all brackets from a javascript string using different methods and example illustrations. While developing in any language, removing the parenthesis from a string is common before processing it. We will also discuss removing square brackets and other brackets in this article. Table of Contents:- Javascript String Remove Parenthesis using replace() Javascript …
JavaScript Remove Zeros from a String
This article will remove all zeros from a javascript string using different methods and example illustrations. While developing in any language, removing zeros from a string is common before processing it. Here, we will discuss removing leading zeros, trailing zeros, and other zeros within the string. We will be using replace() and replaceAll() methods of …
JavaScript Remove Hyphens from a String
This article will remove all dashes (‘-‘) from a javascript string using different methods and example illustrations. While developing in any language, removing dashes or hyphens from a string is common before processing it, as it might be a phone number, for example. Table of Contents:- Javascript String Remove Hyphens using replace() Javascript String Remove …