Quantcast
Viewing all articles
Browse latest Browse all 5

switch case help

String is Immutable. Is it good to do ToLower since it creates a new copy of the string in memory.
Is there any better option to eliminate such situations?
The ultimate goal is to get a match from the switch. Trim as well as ToLower both return a new copy of the string and don't change the original. The switch gets a reference to the final result from ToLower and all is well. The cost of the new strings is negligible and conveniently cleaned up by garbage collection almost immediately.

William Wegerson (www.OmegaCoder.Com)

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>