- Home /
[solved] replace char with string UNITY
I see that there is a someString.Replace(char, char) and someString.Replace(string, string). How can I do this: someString.Replace(char, String) ?
when I just do:
string newString = oldString.Replace('a', 'abc');
Unity thinks I want to replace a char and says: Assets/InputScript.cs(22,72): error CS1012: Too many characters in character literal
Suggestions? Thanks
Comment
Best Answer
Answer by fafase · Mar 19, 2014 at 09:21 AM
Have you tried:
string newString = oldString.Replace("a", "abc");
Now I have, and it worked! Thank you... So stupid of me