I have:
tXML = "<type p_type=\"All\"/>";
if I do
Response.Write(tXML);
I get a blank space.
Is there anyway to output this string so I know it is being created?
I'm trying to use sed to replace whitespace within a string. For example, given the line:
var test = 'Some test text here.';
I want to get:
var test = 'Sometesttexthere.';
I've tried using (\x27 matches the '):
sed 's|\x27\([^x27[:space:]]*\)[[:space:]]|\x27\1|g
but that just gives
var test = 'Sometest text here.';
Any ideas?
Hello,
I am writing a piece of code in which i have to find only complete words for example if i have
String str = "today is tuesday";
and i am searching for "t" then i should not find any word.
Can anybody tell how can i write such a program in java?
Hi all
I have a string with file content .
But my function deals with file path on the disc .
Any idea how i can solve this problem without writing to the disc my file content ?
Thanks for help.
Trying to find a way to trim spaces from the start and end of the string. I was using this, but it dont seem to be working:
title = title.replace(/(^[\s]+|[\s]+$)/g, '');
Any ideas?
Hi-- I have a UK date in the format "06/Apr/2010 13:24" that I need to insert into a mysql db date field.
The PHP strtotime function can't handle this string-- has anyone got any ideas other than writing a custom function?
Thanks!
I am trying to check if a lhs is already abbreviated in vim.
mapcheck, however, seems to have a problem. For example,
iabbr swt switch
echo mapcheck('sw','i',1)
returns "switch" even when "switch" defined for "swt".
mapargs seem to return a string even if there is a partial
match with the lhs. Is there a way to find if an
abbreviation has been defined for the "exact" match, i.e.,
the above mapcheck returning a "" instead.
I'm retrieving an unformatted String from a twitter feed. I want to be able to turn a text URL (http://blah.com/qwerty/) into a link but don't know how...is there a handy regular expression for this?
If e.g. I keep control markup in DB instead of ascx file.
How can I load control from string constant?
(of course if I don't want to save copy to disk)
What could be the easiest way to match all links and e-mail addresses in a string to a list array? I was using preg_match in PHP but in C# it looks like it will be way different.
I am trying to convert a string (const char* argv[]) to a double precision floating point number:
int main(const int argc, const char *argv[]) {
int i;
double numbers[argc - 1];
for(i = 1; i < argc; i += 1) {
/* -- Convert each argv into a double and put it in `number` */
}
/* ... */
return 0;
}
Can anyone help me? Thanks
How can I convert a string to JSON in javascript, is there a method that does that?
Something like:
var x = "{ id: 5, name: 'hello' }";
var y = /*something*/(x);
alert(y.id + " " + y.name);
Is there a difference between these ?
if(myString.equals("")){
}
if(myString.equals(null)){
}
if(myString == ""){
}
I have a string, I don't know is it empty or has some emtpy spaces I just wan't to stop it to be written in database if it is invalid(if empty or with some blank spaces).
Hello,
My string contain a lot of HTML entities, like this
"Hello <everybody>" there
And I want to split it by HTML entities into this :
Hello
everybody
there
Can anybody suggest me a way to do this please? May be using Regex? Thanks so much.
Hai frnds i am new to php actually i am facing following problems in coding please can anyone give the solution?
Actually i am having one audio player and i am displaying some word dcoument
if i click word document corresponding audio file should play
actually when i click doc file it should pop ip with save as and open with for that i am using some header code
also i am passing query string in the browser
query string is not working if i use header
can anyone give me a solution for it below is my code i am attaching
<?php
$f_name = $_POST["fn"];
$id = $_POST["id1"];
echo $id;
//echo "../public_html/sites/default/files/ourfiles/$f_name";
$res2=db_query("select * from mt_files where id='".$id."' ");
$row2=db_fetch_array($res2);
$job_audio=$row2["audio_name"];
//echo $job_audio;
//$job_audi=explode("/",$job_audio);
//$job_audio=$job_audi[8];
$job_audio= "C:/xampp/htdocs/med/sites/default/files/audio/$job_audio";
//$job_audio= "C:/Documents and Settings/swuser/My Documents/$job_audio";
//echo $job_audio;
echo "<object data='$job_audio' type='application/x-mplayer2' width='150' height='45'>
<param name='src' value='$job_audio'>
<param name='autoplay' value='true'>
<param name='autoStart' value='1'>
</object> ";
$file = "../mts/sites/default/files/docs/$f_name";
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
//The download table query goes here put the $f_name in insert into with the //time varible
?>
some of code, has below line.
readonly private string
TARGET_BTN_IMG_URL =
@"\ad1-sunglim\Test\";
in this line, why does @ need to be attatched ?
and even in javascript too.
Hi I have Map of String values.
I want to cast this value at runtime.
e.g.
Map map = new HashMap();
map.put("key1","101");
map.put("key2","45.40");
Now runtime I know key1 is integer and key2 is double
How can I cast this.
I tried this:
("101").getClass().cast(Integer).
Thanks.
I have a simple array like:
var myArr=["one","two","three"];
an I have a counting loop, which increases the value of var "i" by one.
What I want to do is print the next value from the array each time the loop runs, next to a text string, like so:
alert('value number '+myArr[i]+);
But for some reason I can't get this to work.
The following code works, so I'm assuming I'm not calling the counter right:
alert('value number '+myArr[0]+);
Hi guys, i've this string example value:
Sun, 09 May 2010 11:16:35 +0200
I've to insert it into MySql Date/Time field.
How can i convert it into .NET format (or Mysql format), so i can make my INSERT INTO mydate='2010-05-09 11:16:35' ?
Thank you !
I'm trying to take a query:
SHOW TABLES;
which will display a bunch of tables with the chat_ prefix. I want to remove the chat_ prefix from the string, format the variable (with a link), and display it. How is this accomplished?
I want to strip away all letters in a string, which are not numeric. Preferably a solution made with Regular Expressions or something. And in C#.
How to do that?