Hi all,
i have strings like "folder1/file1.txt" or "foldername1/hello.txt" and i need to take the substring that identify the folder name with the slash (/) included (example: from "folder1/file1.txt" i need "folder1/"). The folders name are not all with the same length.
How can i do this in C?? thanks
...
Hey Guys,
In my app I store the date as a string("MM/dd/YYYY" format). In the DB. later when I retrieve the string I have to compare two dates, how do I achieve this?
If I had used the"YYYY/MM/dd" format I could have directly compared it as strings.
Now I have to convert back into NSDate object using "nsdateformatter" and "dateFromStri...
I am using NavigateURL to dynamically pull in the url of products on a receipt page.
Here is the exact code:
<a class="blue13" href="<%#Eval("Product.NavigateUrl")%>"><%#Eval("Product.Name")%></a>
It is placing "/checkout/~/" in each of the url.
How can I remove or correct this?
Thanks!
...
How can I replace all line breaks from a string in Java in such a way that will work on Windows and Linux (ie no OS specific problems of carriage return/line feed/new line etc.)?
I've tried (note readFileAsString is a function that reads a text file into a String):
String text = readFileAsString("textfile.txt");
text = text.r...
In Java Swing I have a simple table where in each row the name of the element and a checkbox is included. Users can select any of the elements contained by clicking in the associated check-box. I would like to have a string below the table that constantly keeps track of the number of elements selected (E.g. "3 elements have been selected...
I'm extremely sorry to post such an embarrassingly newbish question, but I haven't mucked around much with C++ since my college days and I think at some point I drank all that I knew about pointers and C++ strings right out of my head. Basically, I'm creating a C++ console app (a roguelike, to be precise) with PDCurses to handle output....
IE g gives me the following error:
Line: 79
Char: 4
Error: Unexpected identifier, string or number
Code: 0
The website is test.hatc.org.
I am using a template that features fading images, opacity and sliding menus. I saw an error pertaining to jquery.min.js in a browser running IE8 with compatibility mode on, so I think it has somethi...
I recently realized that I don't fully understand Java's string encoding process.
Consider the following code:
public class Main
{
public static void main(String[] args)
{
System.out.println(java.nio.charset.Charset.defaultCharset().name());
System.out.println("ack char: ^"); /* where ^ = 0x06, the ack char */
...
Hi.
I often see the following structure, especially in constructors:
class::class(const string &filename)
{
}
class::class(const char * const filename)
{
}
By step-by-step debug, I found out the 2nd constructor is always called if I pass a hard-coded string.
Any idea:
1) Why the dual structure is used?
2) What is the speed diffe...
What is the best way to convert a std::string to bool? I am calling a function that returns either "0" or "1", and I need a clean solution for turning this into a boolean value.
...
Hello all,
I have made a socket listener in java that listens on 2 ports for data and does operation on the listened data. Now the scenario is such that when both the listener and the device that transmits data are up and running, the listener receives data, one at a time ( each data starts with a "#S" and ends with a ".") and when the ...
I am trying to optimize a function which does binary search of strings in Javascript.
Binary search requires you to know whether the key is == the pivot or < the pivot.
But this requires two string comparisons in Javascript, unlike in C like languages which have the strcmp() function that returns three values (-1, 0, +1) for (less than...
Hi, I am trying to request a webpage from an iis web server that I control utilising query strings.
E.g., I have a webbrowser control in my winforms app and request a page similar to "www.site.com/getpage.ashx?field=afsfgwesar+sere"
When i try to run this it fails because on the server side, getpage.ashx can’t locate the right field.
...
How can convert a certain file into in a String? And then from that String to get the original file? This needs to realize it using Java.
It would be greate an example of code or a link to a tutorial.
Have to converted an entire File (not thecontent) in the String and then the String to the File.
Thanks.
...
Hello,
Can anyone help me make a regex or give me a good solution that can split/check the following string:
"<2342Flsdn3Z><9124Fsflj20>"
Everything starts with a "<" and the 6 caracter is a "F" and the string ends with a ">"
Is it possible to make a Regex that can find "strings" like this?
...
How can I convert a decimal code of a character into a Unicode string in C++?
For example, I give it the integer 241, that is the '' spanish letter, and I want to convert it to a Unicode string.
...
I'm trying to learn how to use Lua with C, so by now I want to try running a script without loading it from a file, since I don't want to be bothered with messing up with files.
Can anybody tell me which functions do I need to call for executing a simple string or what ever?
...
Users may want to delimit numbers as they want.
What is the most efficient (or a simple standard function) to extract all the (natural) numbers from a string?
...
I have a string such as:
"0123456789"
and need to split EACH character into an array.
I for the hell of it tried:
explode('', '123545789');
But it gave me the obvious: Warning: No delimiter defined in explode) ..
How would I come across this? I can't see any method off hand, especially just a function
...
hi, i googled around and see lots of discussion about radix sort on binary string, but they are all with same lenght, how aobut binary string with arbitrary lenght?
say i have {"001", "10101", "011010", "10", "111"}, how do i do radix sort on them ? Thanks!
...