#strings

Found 19 articles tagged with #strings

Different ways to concatenate strings in Python

String concatenation involves joining multiple strings together using operators like + or +=, suitable for simple cases where you need to combine fixed strings or variables.

Jul 17, 2024#python#strings

Different ways to reverse a string in Python

The string type in Python does not have a built-in reverse method. However, you can reverse a string using several different methods like slicing or reversed() function.

Jul 16, 2024#python#strings

Converting between strings and numbers in JavaScript

It's important to be aware of the potential pitfalls conversion, such as non-numeric input, decimal precision, and numeric overflow, and to use the appropriate conversion method.

Advanced string formatting with f-strings in Python

F-strings (formatted string literals), introduced in Python 3.6, are a way to embed expressions inside string literals, using curly braces.

Feb 15, 2024#python#strings

How to capitalize first letter in Swift

Capitalizing first letter of each word, the first letter of a sentence, or all caps lies in the specific style and purpose of text presentation.

Jan 28, 2024#swift#strings

How to add zeros before number in javascript

Adding leading zeros to a number is often necessary in scenarios where the representation of the number needs to have a fixed width or format.

Using string substring() or slice() in JavaScript

The main difference between `substring()` and `slice()` in JavaScript is how they handle negative or out-of-range arguments.

How to reverse a string in JavaScript

You can achieve string reversal using array manipulation methods like split, reverse, and join or through loops and other techniques.

How to perform string interpolation in Python

You can use the % operator, format method, or f-strings to perform string interpolation, which is inserting values into a string in Python.

Dec 08, 2023#python#strings

How to compare two strings in Swift

One of the basic operations in Swift is to compare two strings for equality or order. There are different ways to do that, depending on your needs.

Nov 28, 2023#swift#strings