Yaswanth Varma has Published 377 Articles

How to check if a string contains only decimal characters?

Yaswanth Varma

Yaswanth Varma

Updated on 14-Apr-2025 11:46:15

5K+ Views

In many programming scenarios, it is common to validate the user input to ensure it contains the specified value. For example, when accepting age, pin-code or numbers form the user, we make sure the input is entered is completely digits. One specific way to do this is by checking if ... Read More

How to translate a python string according a given dictionary?

Yaswanth Varma

Yaswanth Varma

Updated on 14-Apr-2025 11:43:53

2K+ Views

In Python, translating the string using a dictionary is used for text manipulation, encoding. It is typically achieved by using the str.translate() method along with the str.maketrans() to define the character mappings. The dictionary passed to the maketrans() contains key-value pairs where the keys are characters to replace and ... Read More

How to Convert Lowercase Letters in String to Uppercase in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 14-Apr-2025 11:30:55

4K+ Views

Converting the lowercase letters in a string to uppercase is a common task in Python. When working with the user input or formatting output, Python provides efficient ways to handle the letter casing. The most commonly used method is the built-in string method upper(). We can use loops and list ... Read More

How to check if string or a substring of string starts with substring in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 11-Apr-2025 12:04:01

1K+ Views

In this article we are going to check whether the string starts with the substring or not, It is useful for checking whether the string starts with the substring, which is helpful in tasks like filtering data or validating input. In Python there are various ways to perform this check, ... Read More

How to split string by a delimiter string in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 11-Apr-2025 12:03:31

2K+ Views

While working with the strings in python, we will find the situations to break the string into parts. This is called splitting a string and is usually done based on a delimiter, this is nothing but a character or sequence of characters that separate the parts of the string. Python ... Read More

How to get a space-padded string with the original string right-justified in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 11-Apr-2025 12:02:11

627 Views

In python, Right-aligning the strings with space padding is a common requirement when formatting the text-based output such as reports, logs or tabular data. This can be done by using the built-in string methods. Let's dive into the article, to learn different ways to get a space-padded string with ... Read More

How to find index of last occurrence of a substring in a string in Python?

Yaswanth Varma

Yaswanth Varma

Updated on 11-Apr-2025 12:01:39

15K+ Views

In Python, working with strings is a common task in data processing and text analysis. The common operation is finding the last occurrence of a specific substring. It is useful in situations like extracting the domain names or locating the repeated elements in logs. Python provides several methods to ... Read More

Add a pressed effect on button click with CSS

Yaswanth Varma

Yaswanth Varma

Updated on 20-Feb-2025 12:47:44

2K+ Views

Adding a pressed effect on button click with CSS makes the user feel more interactive with the web page. It provides an immediate visual effect indicating that the button press has been registered. It helps in improving the user experience. In this article, we have a button on our web ... Read More

Get current date/time in seconds - JavaScript?

Yaswanth Varma

Yaswanth Varma

Updated on 27-Jan-2025 12:34:26

13K+ Views

In JavaScript, there are built-in methods for getting the current date and time in seconds. We are going to perform this in two ways − Using the Date.now() method ... Read More

Different ways to apply colors in an HTML document

Yaswanth Varma

Yaswanth Varma

Updated on 02-Dec-2024 14:48:53

335 Views

A website or application with more color is more visually appealing than one with only black and white. We will go over each method of applying color to HTML texts in this article. There is no specific tag for applying colors in HTML document, just like for other HTML tags. ... Read More

Advertisements