[C#/General] 문자열 내의 특정구문을 개별문자(Char) 처리.


[C#/General] 문자열 내의 특정구문을 개별문자(Char) 처리.

public class Example { public static void Main() { string txt = "I am stronger than Batman."; Console.WriteLine(txt); char[] phraseAsChars = txt.ToCharArray(); int searchIndex = txt.IndexOf("Batman"); if (searchIndex != -1) { phraseAsChars[searchIndex++] = 'C'; phraseAsChars[searchIndex++] = 'a'; phraseAsChars[searchIndex++] = 't'; phraseAsChars[searchIndex++] = 'm'; phraseAsChars[searchIndex++]..


원문링크 : [C#/General] 문자열 내의 특정구문을 개별문자(Char) 처리.