Top "String" questions

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

How to check if the string is empty?

Does Python have something like an empty string variable where you can do: if myString == string.empty: Regardless, what's the …

python string comparison-operators
How do I append one string to another in Python?

I want an efficient way to append one string to another in Python, other than the following. var1 = "foo" var2 = "…

python string append
How do I check if string contains substring?

I have a shopping cart that displays product options in a dropdown menu and if they select "yes", I want …

javascript jquery string substring contains
Converting an object to a string

How can I convert a JavaScript object into a string? Example: var o = {a:1, b:2} console.log(o) console.log(…

javascript string object serialization tostring
How to convert strings into integers in Python?

I have a tuple of tuples from a MySQL query like this: T1 = (('13', '17', '18', '21…

python string integer
Extract filename and extension in Bash

I want to get the filename (without extension) and the extension separately. The best solution I found so far is: …

bash string filenames
Creating multiline strings in JavaScript

I have the following code in Ruby. I want to convert this code into JavaScript. what's the equivalent code in …

javascript string multiline heredoc
How to delete a character from a string using Python

There is a string, for example. EXAMPLE. How can I remove the middle character, i.e., M from it? I …

python string
Convert JS object to JSON string

If I defined an object in JS with: var j={"name":"binchen"}; How can I convert the object to JSON? …

javascript json string object
Generate random string/characters in JavaScript

I want a 5 character string composed of characters picked randomly from the set [a-zA-Z0-9]. What's the best way to …

javascript string random