I do not want to change a string nor do I want to check if it contains white space. I want to check if the entire string is ONLY white space. What the best way to do that?
Hello I have something like this:
if(isset($_POST['btnProm'])){
$idads = mysql_real_escape_string($_POST['idAds']);
require_once("adPromFrm.php");
}
When a button is pressed, a form will appear....
When i refresh the page, the form doesn't disappear, but when i click a link with a query string (thisPage.php?lang=fr...), the form disappears.
I know i m asking the form only if the button is pressed, but how can i ignore the query string.
Hi
Is there another way of assigning string path to variable aside from this:
strPath = @"C:\Myfile.txt";
is there another way instead using "@" sign in the string path.
thanks.
I am looking to create a small encrypted string, like the referral strings used by Twitpic or bit.ly, for a website I am working on for referral purposes. Any of the built-in functions like MD5 and mcrypt each make strings that are too long for my purposes.
Is there an easy way to create a string like this? Thanks.
Hi all,
i am quite new in python.
I am receiving (through pyserial) string with data values.
How can I parse these data to particular data structure?
I know that
0-1 byte : id
2-5 byte : time1 =>but little endian (lsb first)
6-9 byte : time2 =>but little endian (lsb first)
and I looking for a function:
def parse_data(string):
data={}
data['id'] = ??
data['time1'] = ??
data['time2'] = ??
return data
thanks
hi
is there any different in Connection string
between SQL server Authentication and Windows Authentication
if yes, can i get a sample connection string for this ?
thank's in advance
How do I return the everything in a string from a sql query before a certain character?
My data looks like this:
HD TV HM45VM - HDTV widescreen television set with 45" lcd
I want to limit or truncate the string to include everything before the dash.
So the final result would be "HD TV HM45VM"
Hi,
I want to ask if there is a way to insert variable inside another string which is part of another statement. For example:
function SomeFunction(field) {
var someVariable = document.getElementById('<%=' + field + '.ClientID %');
}
But I've got an error:
Error 6 'string' does not contain a definition for 'ClientID'
Thank you.
Using String.Format how can i ensure all numbers have commas after every 3 digits
eg 23000 = "23,000" and that 0 returns "0".
String.Format("{0:n}", 0); //gives 0.00 which i dont want.
I dont want any decimal places, all numbers will be integers.
How can I get the reference value of a string object?
If I hava a class like
class T()
{
}
T t = new T();
System.out.println( t);
print out T@a3455467 that is the reference value inside t
but for string? maybe with method hashCode()??
Hi,
I have a string that is
$str = "testingSUB1";
How can I strip out SUB* from the string? I assume using preg_replace but I'm not good with matching what I want with regex.
Does anyone know how I can do this?
Thank you
I am facing severe problem with JDBC ,converting string to integer.
String query = "Select F2, F3, F4 from myTable ORDER BY {fn CONVERT(INT,F4)}" ;
error: Syntax error in ORDER By clause;
How do I return the everything in a string from a sql query before a certain character?
My data looks like this:
HD TV HM45VM - HDTV widescreen television set with 45" lcd
I want to limit or truncate the string to include everything before the dash.
So the final result would be "HD TV HM45VM"
We can replace strings in a batch file using the following command
set str="jump over the chair"
set str=%str:chair=table%
These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it.
set word=table
set str="jump over the chair"
??
Any ideas?
I have a asp:GridView with a HyperLinkField. It's DataNavigateUrlFormatString property is set to View.aspx?id={0}&isTechnical={1}
Select command of appropriate SqlDataSource returns columns of type INT and BYTE (from SQL Server 2008).
So displayed string becomes something like View.aspx?id=1&isTechnical=1. But I want to display isTechnical=true|False, i.e. Convert.ToBoolean(row["isTechnical"]).ToString().ToLowerInvariant().
How to implement such conversion in page markup?
Hi, I am writing a function like this.
func :: IO()
func = putStr print "func = putStr print"
I know it is incorrect but the idea is I want the putStr applied to the string then print applied to the same string "fun = .." so that the output would be:
func = putStr print "func = putStr print"
which is the same as my function definition. Thanks
DataContractJsonSerializer this is nice class added in the .net framework which can be used to serialize/desirealize object into JSON.
Now following is the example i am trying
[Serializable] class User { public string name; public string userId; }
Now following is the output generated
Output : Notice structure where only "name" is expected instead of k__BackingField
Now this is the problem after digging so much i am not sure from where < and _BackingField is coming ?
{
"<name>k__BackingField":"test user",
"<userId>k__BackingField":100001}
How can i convert a hex string lenght 6 bytes for example string ='1122aaccddff';
to raw binary data of lenght 8 byes the last 2 bytes shoul be padded with zeros,
I do not want to change a string nor do I want to check if it contains white space. I want to check if the entire string is ONLY white space. What the best way to do that?
I'm having some troubles getting regex to replace all occurances of a string within a string.
**What to replace:**
href="/newsroom
**Replace with this:**
href="http://intranet/newsroom
This isn't working:
str.replace(/href="/newsroom/g, 'href="http://intranet/newsroom"');
Any ideas?
Thanks,
Tegan
I have written a text editor using JavaScript.
Here I am not storing the written text in any variable, Now I want to replace some text/string of some selected text with other text/string.
Can anyone suggest me, how to do it using JavaScript.
Thanks
Hello,
I'm trying to display some string (html formatted) in a Richtext Ctrl. In my code I tried to use it this way (self.txtmain is the RichTextCtrl):
out = StringIO()
htmlhandler = rt.RichTextHTMLHandler()
buffer = self.txtmain.GetBuffer()
buffer.AddHandler(htmlhandler)
out.write(string)
out.seek(0)
htmlhandler.LoadStream(buffer, out)
self.txtmain.Refresh()
No errors are issued, but the RichTextCtrl windows is not updated.
What am I missing here?
I have the following code :
std::string Utils::get() {
std::string result;
result.append(1, 'x');
result.append(1, 'x');
result.append(1, 'x');
return result;
}
I expect 'xxx' to be returned.
However, when I run under debug mode, I get the warning
"Stack around the variable 'result' was corrupted"
Am I using append function the wrong way?
I'm writing a DSL where the "+" operator is strictly numeric, and the String "+" operator is messing up my implicit conversions. What's the syntax for unimporting an operator of the String class?
Thanks