Top "String" questions

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

How can I convert a std::string to int?

Just have a quick question. I've looked around the internet quite a bit and I've found a few solutions but …

c++ string int
How do I create a Java string from the contents of a file?

I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least …

java string file file-io io
How to generate a random alpha-numeric string

I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string. In my situation it would be …

java string random alphanumeric
How to trim whitespace from a Bash variable?

I have a shell script with this code: var=`hg st -R "$path"` if [ -n "$var" ]; then echo $var fi …

string bash variables trim
Change date format in a Java string

I've a String representing a date. String date_s = "2011-01-18 00:00:00.0"; I'd like to convert it to a Date and …

java string date formatting date-format
Converting string to byte array in C#

I'm converting something from VB into C#. Having a problem with the syntax of this statement: if ((searchResult.Properties["user"].…

c# string vb.net encoding byte
PHP random string generator

I'm trying to create a randomized string in PHP, and I get absolutely no output with this: <?php function …

php string random
Why is it string.join(list) instead of list.join(string)?

This has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print(my_list.join("…

python string list
Convert String to double in Java

How can I convert a String such as "12.34" to a double in Java?

java string casting double type-conversion
Reverse a string in Python

There is no built in reverse function for Python's str object. What is the best way of implementing this method? …

python string