In C#, strings are reference type but behaves like value type. e.g.
string str = "I am a string";
str.Replace("am", "was"); //str still contains same value,
//i want it to make "I was a string"
I know i can do this by
str = str.Replace("am", "was");
But i don't want to re-assign it. Is there anyway to make them behave like Reference type?
Additional:
i am having a key-value pair collection(not dictionary) and i want to prefix some text to its key(string), right now i am removing the key-value pair and then creating a new using the same value and adding that in to the collection. i don't want to do this as this doesn't seem to be a right way. I want to update the Key directly.
Edit:
I might get two collection from Model with the same keys having different values in each collection. so inside View-Model i want to alter the keys by prefixing them with a value for first and second collection separately. And will make all keys unique.