Top "String" questions

A string is a finite sequence of symbols, commonly used for text, though sometimes for arbitrary data.

How do I trim whitespace from a string?

How do I remove leading and trailing whitespace from a string in Python? For example: " Hello " --> "Hello" " Hello" …

python string trim
How to change a string into uppercase

I have problem in changing a string into uppercase with Python. In my research, I got string.ascii_uppercase but …

python string uppercase
Pythonic way to create a long multi-line string

I have a very long query. I would like to split it in several lines in Python. A way to …

python string multiline multilinestring
Java int to String - Integer.toString(i) vs new Integer(i).toString()

Sometimes java puzzles me. I have a huge amount of int initializations to make. What's the real difference? Integer.toString(…

java string int
How do I strip all spaces out of a string in PHP?

How can I strip / remove all spaces of a string in PHP? I have a string like $string = "this is …

php string spaces
How can I print variable and string on same line in Python?

I am using python to work out how many children would be born in 5 years if a child was born …

python string variables printing
What is the correct way to check for string equality in JavaScript?

What is the correct way to check for equality between Strings in JavaScript?

javascript string string-comparison
How do I get a consistent byte representation of strings in C# without manually specifying an encoding?

How do I convert a string to a byte[] in .NET (C#) without manually specifying a specific encoding? I'm going …

c# .net string character-encoding
How to convert UTF-8 byte[] to string?

I have a byte[] array that is loaded from a file that I happen to known contains UTF-8. In some …

c# .net arrays string type-conversion
How do I trim whitespace?

Is there a Python function that will trim whitespace (spaces and tabs) from a string? Example: \t example string\t → …

python string whitespace trim strip