Right now, I'm working on a project which requires sequential text key generation. I need to seed the key generator with an integer corresponding to a certain key, which the constructor converts to a key.
My key generator overloads the increment operators so that the string is incremented directly, rather than what I had previously been...
I need to create a class with exactly the same methods as java.lang.String.
What is the best way to do this in Java?
I know that I can't extend String class as it is final. I am not looking at solutions where I need to copy the source code of java.lang.String. For example, assume that I need the functionality length() within my custom...
From when I learned that the class java.lang.String is declared as final in Java, I was wondering why is that? I didn't find any answer back then, but this post: How to create a replica of String class in Java? reminded me of my query.
Sure, String provides all the functionality I ever needed, and never thought of any operation that wo...
Hi,
Say I have the following string "Center-World" and I want to separate this string in two different strings but I want the dash to be part of "Center". With the code below I got a string with ["Center","World"] and I want something that returns ["Center-","World"].
Here is my code:
NSCharacterSet *stringDelimiters = [NSCharacterSet ...
Russel Peter video: <a rel="nofollow" href="http://www.youtube.com/watch?v=2bP9tRhJRTw">www.youtube.com/watch?v=2bP9tRhJRTw</a> russel peters video blah blah. Turtles: <a href="http://turtles.com">turtles.com</a>
I have a string that contains text and and tags with enclosed urls like the above example.
I want to str...
Specifically, the code sample here works great, but only when the string is stored in a file.
Sometimes I need it to process a generated string (stored in a string variable), but I'm having trouble convincing fgets's third parameter to work with string variables because it's a pointer to a FILE structure.
Or perhaps there's a functio...
Hi All,
Is there any possibility to Edit String.xml values in Android? Please suggest me the possible ways. I want to provide Enable/Disable option for my App. To accomplish this I can use SQLite database. But I doesn't like to Use DB for a single variable value. Thanks in Advance. With Regards, Raghavendra K.
...
I want to compare one string with many strings. How is that done in C#?
...
I am having 4 strings:
"h:/a/b/c"
"h:/a/b/d"
"h:/a/b/e"
"h:/a/c"
I want to find the common prefix for those strings, i.e. "h:/a".
How to find that?
Usually I'd split the string with delimiter '/' and put it in another list, and so on.
Is there any better way to do it?
...
How to calculate the length of a string in C efficiently (in time)?
Right now I'm doing:
int calculate_length(char *string) {
int length = 0;
while (string[length] != '\0') {
length++;
}
return length;
}
But it's very slow compared to strlen() for example, is there any other way to do it?
Thanks.
EDIT: I'm w...
Stuck here trying to initialize an array (c#) using a loop. The number of rows will change depending. I need to get back two values that I am calculating earlier in the program startweek, and endweek. Lots of examples on building int arrays using loops but nothing I can find re dynamic strings and multi dim arrays.
Thanks
how do I set ...
Calling regex gurus. I'm having some trouble right now with escaping a string in Ruby so that I can pass it into a command line utility using exec, %x{} or similar. The command line command is the TextMate dialog feature, which basically works like this (Run this as a shell script in TextMate.):
$DIALOG -mp "items=('string1','string2', ...
I'm trying to figure out how could I parse this string using "sstream" and C++
The format of it is: "string,int,int".
I need to be able to assign the first part of the string which contains an IP address to a std::string.
Here is an example of this string:
std::string("127.0.0.1,12,324");
I would then need to obtain
string someSt...
Is there any difference between single and double quoted strings in ActionScript?
...
I'd like to display a string that containts html code (mainly for formating purposes like italic, bold, indentation, colors etc.) from a C# console application.
I don't think I'll need to go with a WebBrowser class for that, since there won't be any kind of navigation possible.
1) What would be the most straightforward way to do it?
2...
I want to extract information from user-inputted text. Imagine I input the following:
SetVariables "a" "b" "c"
How would I extract information between the first set of quotations? Then the second? Then the third?
...
I have the following string for example:
abcba"c"bacba"fbaf"gdsfgafa"http://www.youtube.com/watch?v=0eLoApO7wrs"gsg
How can I extract the youtube url from this string?
...
Best practice when converting DataColumn values to an array of strings?
[Edit]
All values for certain DataColumn for all DataTable rows to be converted to an array of string?
...
I was working on a project which required pulling down and parsing a .html page from a server, then parsing it for content. I searched a string for two values as a unit test, then saved each of them to a List, then compared them to a manually created String[]. The code is below:
SiteGrabber.java:
//some imports
import java.util.ArrayLi...
I have a problem with boost::interprocess::string in shared memory.
When I use a shared_memory_object I can manipulate a structure with different fields, BUT strings (I get a segmentation fault).
On the other side, when I use managed_shared_memory everything is fine.
Am I doing something wrong? Do you know if there is a performance...