A string is a sequence of zero or more characters. It is commonly used to represent text or a sequence of bytes.
0
votes
2answers
10 views
Java Regex - alphanumeric, allowing leading whitespace but not blank string
I've been trying to make a java regex that allows only alphanumeric characters, which can have white spaces, BUT the whole string cannot be blank...
Few examples..
" hello world123" //fine
...
0
votes
5answers
525 views
How to create a function which randomly jumbles a string
My main function contains a string that I would like to jumble. I have found a piece of code which passes in a char* and returns 0 when complete. I have followed the code providers instructions to ...
0
votes
1answer
9 views
MONGODB Difference between DateTime object and YYYY-MM-DD string
In MongoDB, I only need to make date range queries. But the data set is huge (9 M) and coverting a string to DateTime object (I use Perl script) and then inserting them into MongoDB is very time ...
-4
votes
2answers
51 views
Having string replace all words after x with y
Having string, how can I replace all words, special characters, numbers, what ever is next after x with y.
Example:
Input:
String test = "Hello @\"Thomas Anderson\" how are you? Today is 06/13/2013 ...
1
vote
1answer
17 views
PL/SQL optimize searching a date in varchar
I have a table, that contains date field (let it be date s_date) and description field (varchar2(n) desc). What I need is to write a script (or a single query, if possible), that will parse the desc ...
2
votes
2answers
44 views
Add leading zeroes to a string
I want to add some leading zeroes to a string, the total length must be eight characters. For example:
123 should be 00000123
1243 should be 00001234
123456 should be 00123456
12345678 should be ...
2
votes
3answers
35 views
How can I convert string to float and back to string using a similar method?
How can you convert the string 6.78 to a float?
How can you convert a float 7.89 to a string?
Do both of these questions have similar answers?
0
votes
1answer
42 views
How to separate words by numbers from a string in C
I have a text file called commands.txt which contains some commands followed by some arguments.
Example:
STOP 1 2 4
START 5 2 1 8
MOVE
CUT 0 9
I want to read every line from this text file and to ...
-5
votes
5answers
66 views
Counting Letters in String
I am trying to count the number of letters are in a string file. I want to make a Hangman game, and I need to know how many lines are need to be put there to match the amount in the word. Thanks.
0
votes
4answers
73 views
How to obtain elements from String separated by comas Java
I'm trying to obtain the values of a String, which is separated by comas.
somthing like this: String str = "item1, item2,0 item3, item4, 0 item5 ...."
This strange String it's because I have a KML ...
0
votes
1answer
16 views
XSL if test string comparison not working
I have some XML this looks like this:
<region class="TableInfo">
text
</region>
<region>
text
</region>
I want to write XSL that only preserves that part without the ...
49
votes
20answers
56k views
How do I trim leading/trailing whitespace in a standard way?
Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common ...
0
votes
2answers
20 views
Is there a preferred method of transferring native JavaScript methods to other objects?
In the midst of doing some debugging, I came upon a situation in which it would be preferable to generalize the toUpperCase method. Here are two ways that I came up with:
//Local
foo = [];
...
679
votes
10answers
90k views
Why does this code print “hello world”?
I came across this piece of code, and found it rather interesting. The following print statement would print "hello world". Could anyone explain this?
System.out.println(randomString(-229985452) + " ...
0
votes
1answer
64 views
Scala Converting multiline string to BigInt
I'm trying to parse 100 50-digit numbers from string with below piece of code:
val input = """37107287533902102798797998220837590246510135740250
...