I was looking through my groups’ C# coding standards the other day and there were a couple of legacy items in there that caught my eye. They had been passed down from committee to committee so many times that no one even thought to second guess and try them for a long time. It’s yet another example of how micro-optimizations can often…
Hi!
I cant find the way how to strip the useless section of my string (read from SQL)
I've tried the strreplace and truncate but those was not good at all.
I've got a string variable called $stuff
if $stuff = 145_timestamp i want to clear the _ and the chars after it. so i want to $stuff be 145 only. Thanks.
I have a strange problem replacing chars in string...
I read a .txt file containing russian text, and starting from a list of letters russian to english (ru=en), I loop the list and I WOULD like to replace russian characters with english characters.
The problem is: I can see in the debug the right reading of the russian and the right reading of…
I have a string called userEmail in my Flex 4 app that has a value of:
my%40email.com
I need to have an @ symbol instead of %40, so I run this line:
userEmail.replace("%40","@");
But the string has the same value after. What am I doing wrong?
Thanks for reading.
If I use String.intern() to improve performance as I can use "==" to compare interned string, will I run into garbage collection issues. How does the garbage collection mechanism of interned strings differ from normal strings ?
Pretty simple question I need to get an integer from the user and I only know how to get a string from them. So if there is a way to get an integer from the user or to convert the string to an integer please let me know.
For example I have code below
string txt="I have strings like West, and West; and west, and Western."
I would like to replace the word west or West with some other word. But I would like not to replace West in Western.
Can I use regular expression in string.replace? I used
inputText.Replace("(\\sWest.\\s)",temp); It dos not work.
How can I extract a substring which is composed of the rightmost six letters from another string?
Ex: my string is "PER 343573". Now I want to extract only "343573".
How can I do this?
I wonder wether it is feasible to implement an optimal string generator Class meeting the following requirements:
Generation criteria using regex
Lexicographical order enumeration.
Count propetry
Indexed access
I don't feel comfortable with regular expression: I cannot come up with a starting piece of code but I just think of a naive…
Hey,
I've currently got a webserver set up which I communicate over SOAP with my iPhone app. I am returning a string containing a GUID and when I attempt to compare this with another string I get some strange results:
Why would this not fire? Surely the two strings are a match?
Thanks
I'm retrieving an array of objects from a hidden html input field. The string I'm getting is:
"{"id":"1234","name":"john smith","email":"jsmith@blah.com"},{"id":"4431","name":"marry doe","email":"mdoe@blah.com"}"
Now I need to pass this as an array of objects again. How do I convert this string into array of objects?
Trying to override a tostring in one of my classes.
return string.Format(@" name = {0}
ID = {1}
sec nr = {2}
acc nr = {3}", string, int, int ,int); // types
But the thing is, the result isn't aligned when printed out:
name = test
…
I'm trying to use regular expressions (preg_match and preg_replace) to do the following:
Find a string like this:
{%title=append me to the title%}
Then extract out the title part and the append me to the title part. Which I can then use to perform a str_replace(), etc.
Given that I'm terrible at regular expressions, my code is…
if the last 4 chars in my string(result) are " AND" or the last three chars are " OR" I would like to remove these from the string. So far I have am trying result.trimend and a few other methods but am unsure how to get it working.
Thanks
Sorry if this question is answered already. But I didn't find suitable answer.
I am having a string expression in C# which I need to convert to an int value or decimal anything. For example,
string strExp="10+20+30";
output should be=60.
how shall I do that???
I'm retrieving an array of objects from a hidden html input field. The string I'm getting is:
"{"id":"1234","name":"john smith","email":"jsmith@blah.com"},{"id":"4431","name":"marry doe","email":"mdoe@blah.com"}"
Now I need to pass this as an array of objects again. How do I convert this string into array of objects?
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…
Hello all, I have a question regarding the some data which is being transfered from one form to my class. It's not going quite the way i'd like to , so I figured maybe there is someone who could help me.
This is my code in my class
Public Class DrawableTextBox
Inherits Drawable
Dim i_testString As Integer
Private…
A Flash AS3 IRC application sends me a string like "f\reak" to my javascript. Irc allows the \ in usernames which poses a problem when its passed to javascript.
"f\reak" become "feak" in javascript making the \r into a carriage return.
Is there a way to read the absolute value of the string instead of parsing a carriage…
Ok guys I imagine this is easy but I can't seem to find how to copy a string. Simply COPY to the system like CTRL+C on a text.
Basically I want to copy a string so I can for example, lets say, paste(ctrl+v).
Sorry for such a trivial question, haha.
I want to build an SQL string to do database manipulation (updates, deletes, inserts, selects, that sort of thing) - instead of the awful string concat method using millions of "+"'s and quotes which is unreadable at best - there must be a better way.
I did think of using MessageFormat - but its supposed to be used…
hello, i have a table with a date, this date is a string i want to compare this string with a date in my request.
SELECT FE_CLIENT.*
FROM FE_CLIENT
WHERE D_DATFINPUBLI < '2010/06/03'
How can i cast my column date_deb to a date for compare ..?
Hello
I've a string @mainString = 'CATCH ME IF YOU CAN'. I want to check whether the word 'ME' inside @mainString.
So how to check if a string has a substring in sql?
Thank you
Regards
NLV