Mirror characters of a string | C # code to find the reverse alphabetical order from a given position ; Function which take the given string and the position from which the reversing shall be done and returns the modified string ; Creating a string having reversed alphabetical order ; The string up to the point specified in the question , the string remains unchanged and from the point up to the length of the string , we reverse the alphabetical order ; Driver function
using System ; class GFG { static String compute ( string str , int n ) { string reverseAlphabet = " zyxwvutsrqponmlkjihgfedcba " ; int l = str . Length ; String answer = " " ; for ( int i = 0 ; i < n ; i ++ ) answer = answer + str [ i ] ; for ( int i = n ; i < l ; i ++ ) answer = answer + reverseAlphabet [ str [ i ] - ' a ' ] ; return answer ; } public static void Main ( ) { string str = " pneumonia " ; int n = 4 ; Console . Write ( compute ( str , n - 1 ) ) ; } }