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?
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 BIT (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 have a NSMutableArray with a few NSString objects in , how can i test if
it contains a particular string literal
i tried [array containsObject:@"teststring"] but it doesn't work.
Thanks
I am having code
NSString *cellValue1 = [products1 objectAtIndex:indexPath.row];
when i try to print NSLog(@"cell value is %@",cellValue1);
in log i am not getting anything,
if i use %s, i am getting some symbols, not the string located in cellValue1.
Please help me.
Thanks in advance.
I have a list of strings where by each string is a url to a pdf document. All I want to do is cycle through this list and display each url as a hyperlink on my page. I've seen this done before in MVC where the collection is made avaliable to the view and you can just do a foreach etc etc but I don't know how to do it on a normal asp.net page...
Any help appreciated, cheers!
Hi,
I have a field in my db which is a List.
I add strings to that list and it works fine on the development server.
This is the result: [mat12, bg10]
When I do the same on the deploy server, this is the result: [u'mat12', u'bg10']
I don't understand why it adds "u' '" to the string.
I would really appreciate your help.
Thanks
SELECT a.one + ' test ' +b.two from table1 a right join table1 on a.id =b.id
The problem is that when one is null then it the whole string is null, is there some kind of trick to bypass this problem
msSQL 2005
I have a form and from this I call
dialogPrintDiet.ShowDialog()
which launchs my dialog. I need to pass a string value and need the easiest way to do this in VB.NET
Thnaks
i have a table in access and i would like to get the SQL string from it that will generate the table like:
CREATE TABLE example (
id INT,
data VARCHAR(100)
);
is there any way to do this?
What would be the easiest way to make a CharSequence[] out of ArrayList<String>?
Sure I could iterate through every ArrayList item and copy to CharSequence array, but maybe there is better/faster way?
Hi,
I've got two possible string inputs that my application will receive, and if it matches the following two strings, I need it regex.ismatch() to return true:
"User * has logged out"
"User * has joined"
I'm not that good at regex and just can't figure out how to go about matching the above.
Any help would be great!!!
the following is a part of my code.
string lsStatus;
lsStatus = ((Tv10DBLookup)(Sender)).EditValue.ToString();
while im debuging the code, im getting the following: "lsStatus is not in the context" !
Knowing that (Tv10DBLookup)(Sender)).EditValue is returning the value "Closed"
what does this mean ?
I have a class like this
$.fn.dimeBar = function(custom) {
var var1 = 'test1';
var var2 = 'test2';
if(sometest){
//how can i access var1 or var2 here by using string name of variables
//some thing like alert(this['var1']) -- should alert: 'test1'
}
}
I have a version number with 3 digits as a String,
var version = "1.2.3";
and would like to compare it to another version. To see if version is newer than otherversion,
var otherVersion = "1.2.4";
How would you do it?
At some places in my code, I print debug messages like this:
int ret = getLinkSpeed(device.getSysName(), linkSpeed);
if (ret < 0)
{
logDebug("Failed to obtain port speed for this device. Error: " + std::string(strerror(errno)));
}
From the documentation it is not entirely clear if strerror will return 0 under certain conditions (which would cause my code to crash). Does anyone know if it's safe?
How can I quickly validate if a string is alphabetic only, e.g
var str = "!";
alert(isLetter(str)); // false
var str = "a";
alert(isLetter(str)); // true
Edit : I would like to add parenthesis i.e () to an exception, so
var str = "(";
or
var str = ")";
should also return true.
What is the easiest way to take an objects and convert any of its values from null to string.empty ?
I was thinking about a routine that I can pass in any object, but I am not sure how to loop through all the values.
My goal is to write this:
println "this should be 3: ($1+2)" //this is invalid groovy, it won't run
Yet this is valid in ruby. Is there a way I can put statements that will eval inside a string or must I use complete variables names? I am basically looking for the Ruby equivalent of:
puts "this shoud be 3: #{1+2}" #this is valid ruby
I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionary object when the program is run again.
How would I convert a dictionary object into a string that can be written to a file and loaded back into a dictionary object? This will hopefully support dictionaries containing dictionaries.
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).
string = '
onchange="_Pd.passAttr(this.value,'size','p0_v0_bd');"
Select
</option>
size 6
</option>
size 7
</option>
size 9
</option>
'
I want to extract a list [size 6, size 7, size 8]. How to do and thanks!