Strings are immutableStrings are immutable, and passed by valuepassed by value. Every time you create a string, it will never be changed. So unlike instances of classes, you cannot modify a string by handing it to a method which modifies it.
In this case, since you return the modified String in namechanger, all you need to do is make sure you assign myname to the result of that method; like so
myname = namechanger(myname); Primitive types (int, float, long, etc) work this way, as do struct instances - so be sure to look for that in the future, if you're ever unsure why a struct's value is not changing when you pass it into a method.