As strange as I find this, I have not been able to find a good PHP function anywhere which will do an intelligent parse of a user agent string? Googled it for about 20 minutes now.
I have the string already, I just need something that will chop it up and give me at least browser/ver/os.
Know of a good snippet anywhere?
Hi everyone!
i'm a newbie in Jquey and i don't know how to do my homework, pls help me !
i have a String EX: this is my text, press here.
Now i put in o block character : [here]
how can a take slipt string and get text in [ ] into variable 'done'?
thankyou !
I have the string like this,
$inp1 = "3 doses at 0[0,0], 1-2 and 6 Month[6,1] [3,2])";
in this internally, going to take the values of square bracket. How can i take this values in the square bracket? any function is there to return the string like this
[0,0] [6,1] [3,2]
Thanks in advance for help.
A Ruby dev I know asked this; my answer is below... Are there other, better reasons?
Why do so many Ruby programmers do
"{string}"
rather than
string
since the second form is simpler and more efficient?
I am trying to convert a block of text that contains html text - i'd like to find all http links and convert them for link tracking purposes.
So eg anything like this in a string would be converted to the latter
<a href="http://www.google.com">Some Link</a>
<a href="http://www.mysite.com/tracking.php?url=www.google.com">Some Link</a>
Can anyone how to do this taking into account the original string will consists of all sorts of html, images etc..
How would I refer to a hash using the value of a string - i.e.
#!/usr/bin/env ruby
foo = Hash.new
bar = "foo"
"#{bar}"["key"] = "value"
results in
foo:5:in `[]=': string not matched (IndexError)
from foo:5
How do I use the value of bar (foo) to reference the hash named foo? Thanks!
How can I get the first character in a string using Ruby?
Ultimately what I'm doing is taking someone's last name and just creating an initial out of it.
So if the string was "Smith" I just want "S".
Somehow I can't seem to get string replacement within a foreach loop in C# to work. My code is as follows :
foreach (string s in names)
{
s.Replace("pdf", "txt");
}
Am still quite new to LINQ so pardon me if this sounds amateurish ;)
Hi all,
I have a string, for example; "llama,goat,cow" and I just need to put a '@' in front of each word so my string will look like "@llama,@goat,@cow", but I need the values to be dynamic also, and always with a '@' at the beginning.
Not knowing a great deal of C++ could someone please help me find the easiest solution to this problem? Many thanks in advance.
I need to itereate a loop to every time find the string appearing after a particular string say "if(OLD.", then which PHP function will be helpfull for me?
I got an adress example: 0x003533 , its a string but to use it i need it to be a LONG but i dont know how to do it :S has anybody a solution?
so string: "0x003533" to long 0x003533 ??
Is it possible to evaluate a String as EL expression in JSP and get value from it?
I need an expression like ${model.${fieldPath}} where fieldPath will contain the required object path from a nested object model.
I can get the actual field path by using but I am not sure how to evaluate a string and get the value from it
Any help regarding this would be highly appreciated.
In the C++ Standard Library, std::string has a public member function capacity() which returns the size of the internal allocated storage, a value greater than or equal to the number of characters in the string (according to here). What can this value be used for? Does it have something to do with custom allocators?
i am trying to do
public string str = txtText.Text;
but it wont let me use txtText.txt so how would I declare that so it can be used everywhere?
I can't use it in the button1_click event because if I do it messes it up because I am having a string retrieve from the textbox and set to the textbox so it doesn't work right so I have to have it retrieve the textbox's text somewhere else then set to it.
I am trying to write a batch file that will examine a given directory, read each file for a given string "Example" and then delete any files that contain the string. The files are also System Files so I don't know what the exact extension is or if that matters (maybe you can just omit a file type filter and have it read all files?). Some of the files will be locked from reading as well so it needs to handle access denial errors if that occurs, not sure how batch files handle that.
I'm quite a beginner in C# , empty string to double conversion can be carried out under the button1_click event ..but doing it under Public Form1() it gives me this error
Input string was not in a correct
format.
how to solve this please ?
thanks in advance .
my string style like this:
expression1/field1+expression2*expression3+expression4/field2*expression5*expression6/field3
a real style mybe like this:
computer/(100)+web*mail+explorer/(200)*bbs*solution/(300)
"+" and "*" represent operator
"computer","web"...represent expression
(100),(200) represent field num . field num may not exist.
I want process the string to this:
/(100)+web*+explorer/(200)bbs/(300)
rules like this:
if expression length is more than 3 and its field is not (200), then add brackets to it.
Ok I have a string...
$a_string = "Product";
and I want to use this string in a call to a object like this:
$this->$a_string->some_function();
How the dickens do I dynamically call that object?
(don't think Im on php 5 mind)
In python I can construct a HTML string without worrying about escaping special characters like < or " by simply enclosing the string in triple quotes like:
html_string = """
<html>
<body>
<p>My text with "quotes" and whatnot!<p>
</body>
</html>
"""
Is there a similar way to do this in Java?
I'm working on 2 cases:
assume I have those var:
a = "hello"
b = "hello-SP"
b = "not_hello"
1 - Any partial matches
I want to accept any string that has the var a inside, so b and c would match.
2 - Patterned match
I want to match a string that has a inside, followed by '-', so b would match, c does not.
I am having problem, because I always used the syntax /expression/ to define Regexp, so how dinamicaly define an RegExp on Ruby??
I have a following string that I would like to parse into either a List or a String[].
(Test)(Testing (Value))
End result should be Test and Testing (Value)