864
2020-03-18 11:22:28
0
private string MakePureWord(string word)
{
// 1) 단어를 소문자화 하고,
word = word.ToLower(new CultureInfo("en-US", false));
// 2) symbol 목록의 특수기호들을 없애고,
return RemoveCharacter(word);
}
private string RemoveCharacter(string word)
{
foreach (var symbol in symbols)
{
if (word.IndexOf(symbol) == (word.Length - 1) || word.IndexOf(symbol) == 0)
{
return RemoveCharacter(word.Replace(symbol, ""));
}
}
return word;
}