|
I'm working on a school project in eclipse, and when I try and use the isEmpty() method on a String, Eclipse shows up the following error:
"The method isEmpty() is undefined for the type String"
I've run the Java updates, but am still getting it. Is any...
Started by Aaron Moodie on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
To configure Eclipse to use.
Can use StringUtils.isEmpty(String) from Apache's commons-lang library.
|
|
Hi!
i need to replace an undefined tags inside an xml string.
example: <abc> <>sdfsd <dfsdf></abc><def><movie></def> (only <abc> and <def> are defined)
should result with: <abc> <>sdfsd...
Started by Jack on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This:
string s = "<abc> <>sdfsd <dfsdf></abc><def><movie></def>"; string regex = "<(?!/?(?:abc|def)>)|(?<!</?(?:abc|def))>"; string result.
|
|
I need to write a templated function replace_all in C++ which will take a string, wstring, glibmm::ustring etc. and replace all occurrences of search in subject with replace .
replace_all.cc
template < class T > T replace_all( T const &search, T...
Started by Tometzky on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Template std::string replace_all( std::string const& search, std::string const& replace, std::string const& subject ); template glibmm::ustring replace_all( glibmm::ustring const& search, glibmm.
|
Ask your Facebook Friends
|
Say I have the following code:
function One() {} One.prototype.x = undefined; function Two() {} var o = new One(); var t = new Two();
o.x and t.x will both evaluate to undefined . o.hasOwnProperty('x') and t.hasOwnProperty('x') will both return false;...
Started by Claudiu on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Something like this?
function isDefined(var....
Prop); if (o.x === undefined && contains(prop, 'x')) { //x is defined, but set to undefined }
where putting a watch on One.x but that would only tell you at the time it gets undefined.
|
|
Why am I getting a textbox that returns undefined list of variables?
When I run this code:
var query = (from tisa in db.TA_Info_Step_Archives where tisa.ta_Serial.ToString().StartsWith(prefixText) select tisa.TA_Serial.ToString()).Distinct().Take(Convert...
Started by Scott on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I believe we've found a....
It is a horrible thing to do.
I have to add some kind of character to the numbers to make their value now looked upon as a string.
I have converted it to a string and still got nothing.
At them as strings.
|
|
I've been using XAMPP version 1.6 with no problems.
I changed to version 1.7 and with my same code, I'm getting a whole lot of messages like
Undefined variable and Undefined Index
my code is:
$row = mysql_fetch_row($Results)
$netassets[$row[4]] = $netassets...
Started by mickeymouse on
, 12 posts
by 3 people.
Answer Snippets (Read the full thread at apachefriends):
In line 112
Notice: Undefined index: 9 ...in line: Undefined variable: Bal....
Row[5]] = ($Bal[$row[5]] + $row[3]);}
The error msgs I get are:
Notice: Uninitialized string offset: 1 ...in line 111
Notice: Undefined index: 2 ...
|
|
Could anyone please tell me how to find if a variable is undefined. I currently have:
var page_name = $("#pageToEdit :selected").text(); var table_name = $("#pageToEdit :selected").val(); var optionResult = $("#pageToEditOptions :selected").val(); var...
Started by Phil Jackson on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Var string = "?z=z"; if (page_name) { string += ....
If not defined it will return a falsy value.
(Also there no stringYou can just check the variable directly .
Z&page_name=pageX */
This avoids using typeof whatever === "undefined" .
|
|
Why does the the RegExp /^\w+$/ match undefined ?
Example code:
alert(/^\w+$/.test(undefined));
This will display true in Firefox 3 (only browser I tested it on).
Started by cdmckay on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
See ECMAScript Specification section to a string....
When undefined is cast to a string (which the regex does), it produces the string "undefined", "f"]
It is treating undefined as the string "undefined".
|
|
Hello,
I'm a bit confused about Javascript undefined & null.
Firstly what does if (!testvar) actually do? Does it test for undefined and null or just undefined?
Secondly, once a variable is defined can I clear it back to undefined (therefore deleting ...
Started by AJ on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
The best way to check for a null values is
if ( testVar !== null ) { // do action here }
and for undefined
if ( testVar !== undefined )....
So null , 0 , false , NaN and "" (empty string) will all appear false.
Into a boolean value.
|
|
So I have been through most of the questions here. Also quite a few articles good and bad.
One thing I am looking for some additional clarification on is how undefined and un declared variables are treated.
Take the code below.
var a; if(a == null) //...
Started by Knife-Action-Jesus on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
I have to navigate through object where any of the parents... .
A variable which has beenI can immediately assume c is undefined if a is undefined?
Yes.
It with the typeof operator (and its result will be the string "undefined" ).
|