Hi Everyone,
For the next week, I'm stuck with a sadly very slow 1-bar EDGE internet connection, so forgive me if I didn't spend quite enough time researching this one, but I just set up a local server for testing code that I would normally test over the internet, and it doesn't seem to be working the same way on my local LAMP install.
...
Hello,
How would I, in objective-c, make it so only strings with a-z characters were allowed? I.E. no & characters, no - characters, etc.
Thanks!
Christian Stewart
...
I have the following string...
1,2,3,4,5,6
I want to have this like
'1','2','3','4','5','6'
To use in MySQL's WHERE IN ()
Would anyone know the best way to do this?
Thanks!
...
This code is not valid:
private void Foo(string optionalString = string.Empty)
{
// do foo.
}
But this code is:
private void Foo(string optionalString = "")
{
// do foo.
}
Why? Because string.Empty is a readonly field, not a constant, and defaults for optional parameters must be a compile-time constant.
So, onto my question....
Hi!
I have three floats that I want to output as a 2 decimal places string.
amount1 = 0.1
amount2 = 0.0
amount3 = 1.87
I want to output all of them as a string that looks like 0.10, 0.00, and 1.87 respectively.
How do I do that efficiently?
...
hi.. can anybody help me to debug this... i have the following errors when executing the bolow code..
Error 1 Cannot implicitly convert type 'string' to 'long'
Error 2 The name 'inputNum' does not exist in the current contex
protected void Button1_Click(object sender, EventArgs e) {
var englishTranslation = IntegerT...
I'm trying to implement a requirement that requires I set a maximum line length for the contents of a div element. But when I open the page in Firefox, I get an error about a "long-running script" and am asked to Continue, Debug, or Stop Script. I don't understand why this is happening. This is my code:
<html>
<head>
<sc...
I am to convert a C# program into Java. At one point I really don't get what is done, there. I changed the code to clarify the types and give an example.
string myString = "Test";
long l = (long)myString[0];
1) What is the [0] doing with a normal string? Is that even possible? Is it just the substring, in this case "T"?
2) How could ...
Hi, I have a UTF-8 string (created an std::string from a byte array)
I understand that the encoding means that the size()/length() won't give me the actual number of glyphs if the text is chinese for instance...
I understand that in order to get the unicode character code of each glyph I need to convert it to wstring (or any UTF>8 repres...
Hi,
I want to add double quote in c# string.
string searchString = "123";
string inputString = "No matches found for "+ "\""+searchString + "\"";
OutPut: No matches found for "123"
THanks,
...
Hi everyone,
I need to dump an xml string (coming into a web service as a POST param), directly into a Mysql DB. The column into which I am writing is currently of type 'text', though I have tried blob as well.
Right now, when I save the string and retrieve it later on using sql, it comes back in a serialized like format, like this:
a:...
I have a string value that needs to be converted into my user defined custom type. how to do this, please help me.
public class ItemMaster
{
public static ItemMaster loadFromReader(string oReader)
{
return oReader;//here i am unable to convert into ItemMaster type
}
}
...
I want to turn an array or list of ints into a comma delimited string, like this:
string myFunction(List<int> a) {
return string.Join(",", a);
}
But string.Join only takes List<string> as the second parameter. What is the best way to do this?
...
I am getting an exception when I try to do a replaceAll:
Symbols is a valid string.
private String buildQuery(){
String query = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(**QUERY**)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&cal...
I want the text "REPLACEME" to be replaced with my StringBuffer symbols. When I print symbols, it is a valid string. When I print my query, it still has the text REPLACEME instead of symbols. Why?
private String buildQuery(){
String query = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%...
It's a pretty common algorithm in command line parsing. Given a set of predefined long option names -- compute the shortest prefix that uniquely identifies one of these options. So for instance, for the following options:
-help
-hostname
-portnumber
-name
-polymorphic
This would be the output:
-he
-ho
-por
-n
-pol
I'm thinking tw...
char * function decode time()
{
tm *ptm; //time structure
static char timeString[STRLEN]; //hold string from asctime()
ptm = gmtime( (const time_t *)<ime ); //fill in time structure with ltime
if(ptm)
{
strncpy(timeString, asctime( ptm ), sizeof(timeString) );
//EDIT
sprintf(test, "Sting is: %s", tim...
I want to demonstrate with a few line of code that in Java, that to compare two strings (String), you have to use equals() instead of the operator ==.
Here is something I tried :
public static void main(String Args[]) {
String s1 = "Hello";
String s2 = "Hello";
if (s1 == s2)
System.out.println("same strings");
else
...
Hi,
I want to make a C char array from NSString object in Obj-C.
My string is:
NSString *string = [[NSString alloc] initWithContentsOfURL:url usedEncoding:nil error:nil];
Can someone send me a sample of a working code?
Thanks in advance,
Sagiftw
...
Ok, so I'm rendering a partial view control in memory that generates HTML that I would like to get to a PDF renderer. The renderer only takes a string as an argument. I have a MemoryStream containing the HTML that I need to get to the renderer.
This is what I'd like to do:
inStream is the MemoryStream of HTML from the partial view.
do...