About 38,700,000 results
Open links in new tab
  1. How to check if the string is empty in Python? - Stack Overflow

    Does Python have something like an empty string variable where you can do: if myString == string.empty: Regardless, what's the most elegant way to check for empty string values? I find …

  2. python - Remove all whitespace in a string - Stack Overflow

    Oct 1, 2016 · All string characters are unicode literal in Python 3; as a consequence, since str.split() splits on all white space characters, that means it splits on unicode white space …

  3. How do I append one string to another in Python?

    Dec 14, 2010 · For handling multiple strings in a list, see How to concatenate (join) items in a list to a single string. See How do I put a variable’s value inside a string (interpolate it into the …

  4. python - How do I split the definition of a long string over multiple ...

    See also: How can I do a line break (line continuation) in Python (split up a long line of source code)? when the overall line of code is long but doesn't contain a long string literal.

  5. Convert bytes to a string in Python 3 - Stack Overflow

    Mar 3, 2009 · 430 Decode the byte string and turn it in to a character (Unicode) string. Python 3:

  6. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · For handling a few strings in separate variables, see How do I append one string to another in Python?. For the opposite process - creating a list from a string - see How do I …

  7. python - What does the 'b' character do in front of a string literal ...

    Apparently, the following is the valid syntax: b'The string' I would like to know: What does this b character in front of the string mean? What are the effects of using it? What are appropriate

  8. python - Remove final character from string - Stack Overflow

    Apr 25, 2022 · The resulting string is stored in output_str. This approach may be useful if you want to remove only the last occurrence of a specific character from the string, rather than …

  9. python - Changing a character in a string - Stack Overflow

    Aug 4, 2009 · Strings are immutable in Python, which means you cannot change the existing string. But if you want to change any character in it, you could create a new string out it as …

  10. python - How do I put a variable’s value inside a string (interpolate ...

    See for example How to use variables in SQL statement in Python? for proper techniques. If you just want to print (output) the string, you can prepare it this way first, or if you don't need the …