Top "String" questions

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

How to search and replace text in a file?

How do I search and replace text in a file using Python 3? Here is my code: import os import sys …

python python-3.x string file replace
Get an OutputStream into a String

What's the best way to pipe the output from an java.io.OutputStream to a String in Java? Say I …

java string io stream
When should I use double or single quotes in JavaScript?

console.log("double"); vs. console.log('single'); I see more and more JavaScript libraries out there using single quotes when …

javascript string conventions
Get the last 4 characters of a string

I have the following string: "aaaabbbb" How can I get the last four characters and store them in a string …

python string
How to remove all line breaks from a string

I have a text in a textarea and I read it out using the .value attribute. Now I would like …

javascript regex string
How to test if string exists in file with Bash?

I have a file that contains directory names: my_list.txt : /tmp /var/tmp I'd like to check in Bash …

string bash file
PHP: How to generate a random, unique, alphanumeric string for use in a secret link?

How would it be possible to generate a random, unique string using numbers and letters for use in a verify …

php string random uniqueidentifier
How can I check if a string represents an int, without using try/except?

Is there any way to tell whether a string represents an integer (e.g., '3', '-17' but not …

python string integer
Android: How do I get string from resources using its name?

I would like to have 2 languages for the UI and separate string values for them in my resource file res\…

android string resources
C# List<string> to string with delimiter

Is there a function in C# to quickly convert some collection to string and separate values with delimiter? For example: …

c# string list delimiter