using System;
class Program
{
static void ReverseWord(ref string str, string word) {
int pos = str.IndexOf(word);
if (pos != -1) {
char[] wordArray = word.ToCharArray();
Array.Reverse(wordArray);
string reversed = new string(wordArray);
str = str.Substring(0, pos) + reversed + str.Substring(pos + word.Length);
}
}
static void Main()
{
string str = "C++ C Java Python PHP C#";
string word = "Java";
ReverseWord(ref str, word);
Console.WriteLine(str);
}
}
/*
run:
C++ C avaJ Python PHP C#
*/