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?
Hi
with linux bash shell , how can i use regex to get a certain string of a file
by example:
for filename *.tgz
do
"get the certain string of filename (in my case, get 2010.04.12 of file 2010.01.12myfile.tgz)"
done
or should I turn to perl
Merci
frank
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.
So I just tried excluding String[] args from the main method
It compiled alright !
But JVM is showing an exception
Why did it compile when String[] args HAS to be included every time ?
What is going on here ? Why won't it show a compilation error ?
typing this made me think that may be compiler did not see it as THE main method ..is that so ?
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
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
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 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 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.
I have string value in that I need to convert to double in VB.Net. Conditions are like below
string = "12345.00232232"
if condition is 3 (2 digits after decimal and comma)
display = 12,345.00
if condition is 5 (5 digits after decimal and comma)
display = 12,345.00232
If Condition is 7 ( 5 digits after decimal and no comma)
display = 12345.00232
How can I do that in VB.Net?
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 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"
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}
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.
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 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?
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
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,
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
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
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