07-21-2012, 10:29 PM
Anyone with any thoughts on how to do the following most elegantly in QM?
If I want to modify a string and also preserve the original string value, I can't do something like this:
because it will modify the OriginalString the same way. So instead I do it this way:
It seems like this requires an extra step. Is there a more elegant way of doing this?
S
If I want to modify a string and also preserve the original string value, I can't do something like this:
str OriginalString = "AbCd"
str AllUpperCaseVersion = OriginalString.ucase
out OriginalString
out AllUpperCaseVersion
because it will modify the OriginalString the same way. So instead I do it this way:
str OriginalString = "AbCd"
str AllUpperCaseVersion = OriginalString
AllUpperCaseVersion.ucase
out OriginalString
out AllUpperCaseVersion
It seems like this requires an extra step. Is there a more elegant way of doing this?
S