using System.Collections.Generic;
public static void Main()
char [] str = {'h', 'e', ' ' , 'l', 'l', 'o', ' ', ' ', 'w', 'o', 'r', 'l', 'd', ' ', ' ', ' ', ' ', ' ', ' '};
private static void urlIfy(char[] str)
int tail = str.Length - 1;
for(int i = 0; i <= str.Length - 1; i++)
if(Char.IsWhiteSpace(str[i]))
shiftLetters(tracker, tail, str);
addLetters(tracker, str);
private static void shiftLetters(int currentIndex, int length, char[] str)
for (int i = length, j = length - 2; j > currentIndex; i--, j--)
private static void addLetters(int currentIndex, char[] str)
string lettersToAdd = "%20";
for(int i = 0; i <= lettersToAdd.Length - 1; i++)
str[i + currentIndex] = lettersToAdd[i];