Omgili - forum search, search forums  
  

Discussions about string versus string

Displaying 1 - 10 out of 7,338 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
What is the value of using IDictionary here?
Started by on , 4 posts by 4 people.  
} You can use it like this: Dictionary<string, string> a = new Dictionary<string, string>(); SortedDictionary<string, string&....
A method like this: void DoSomething(IDictionary<string, string> d) { //...
Quick one; am I right in thinking that passing a string to a method 'as a CONST' involves more overhead than passing a string as a 'VAR'? The compiler will get Delphi to make a copy of the string and then pass the copy, if the string parameter is declared...
Started by on , 5 posts by 5 people.  
In both cases....
You will get a bigger const or var in your case .
Using const saves you the overhead of incrementing/decrementing the refcounter for the string that you use.
The compiler won't make a copy of the string when using const afaik.
Object obj = "Hello"; string str1 = (string)obj; string str2 = obj.ToString(); What is the difference between (string)obj and obj.ToString() ?
Started by on , 6 posts by 6 people.  
Which is obj itself when obj is a string .
Obj.ToString() gets a string representation of obj by calling the ToString() method.
Obj must already be a string for this to succeed.
string)obj casts obj into a string .
Ask your Facebook Friends
I'm interested in both style and performance considerations. My choice is to do either of the following ( sorry for the poor formatting but the interface for this site is not WYSIWYG ): One: string value = "ALPHA"; switch ( value.ToUpper() ) { case "ALPHA...
Started by on , 7 posts by 7 people.  
In fact, it will throw an ....
One thing to consider is would you need the valuesThe second option is marginally faster, as the first option may require a full string comparison range.
When switching on a string value versus an enum.
I was recently trying to explain to a programmer why, in ASP.Net, they should create HTMLControls instead of creating HTML strings to create Web pages. I know it is a better way of doing things, but I really couldn't give concrete reasons, other than,...
Started by on , 6 posts by 6 people.  
One big advantage: Writing HTML as a string is hugely prone to human.
From a code that might break xhtml compliance.
The resulting manual HTML is such a mess that it's impractical to maintain as a string.
I have two LinkedList objects that are always of the same size. I want to compare them to see if they are identical in content. What are the general performance and style implications of creating a ListIterator for each list and using a while hasNext ...
Started by on , 4 posts by 4 people.  
The code is: public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof List)) return false; ListIterator<E> e1 = listIterator... .
As it turns out AbstractList.equals() (which LinkedList uses) will do this automatically so use that .
I've discovered that std::string's are very slow compared to old-fashioned null-terminated strings, so much slow that they significantly slow down my overall program by a factor of 2. I expected STL to be slower, I didn't realise it was going to be this...
Started by on , 12 posts by 12 people.  
If you are experiencing performance to read a std::string commandline parameter, then a lock would be needed even just to read the string, and the memory is freed.)....
string is as efficient as char*, but with the added protection.
In Python, the where and when of using string concatenation versus string substitution eludes me. As the string concatenation has seen large boosts in performance, is this (becoming more) a stylistic decision rather than a practical one? For a concrete...
Started by on , 8 posts by 8 people.  
Concatenation is useful when you....
In fact, your string interpolation version.
String interpolation allows you to easily add formatting.
I only use concatenation if I'm building a string up in say.
I use substitution wherever I can.
I'm a little confused about when to use single quoted strings versus double quoted strings. I've noticed that if I put a variable inside a single quoted string, it doesn't get interpreted. Also, if I use a newline character in a double quoted string, ...
Started by on , 5 posts by 5 people.  
Single-quoted strings are treated it is supplementary information....
Is this because the '\ ' is interpreted as a special character in the double quote string but in the single quoted string the characters are preserved as is? Yes.
Hello, I know that using single quotes around a string in PHP is faster than using the double quotes because PHP doesn't need to check for variable presence in the single quoted string. My question is which will perform better: A) A double quoted string...
Started by on , 7 posts by 7 people.  
So 1 concatenation may be faster, but 6 may be considerably slower .
Difference is really low: PHP double versus single quotes by Dave Dash I recently read another article (can't string (or so I've been told).
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost