Problem

3 /4


Search in a string

Theory Click to read/hide

To search within a string in C#, the IndexOfAny(Char []) and LastIndexOfAny(Char[]);
IndexOfAny(Char) Returns the zero-based index position of the first occurrence in this instance of any one or more characters specified in a Unicode character array. 
LastIndexOfAny(Char[]) does the same, only returns the index of the last occurrence. 

When the substring is not found, the methods return -1.

string welcome = "Hello world! Goodbye world!"
int x = welcome.IndexOfAny(new Char[] {'w'}); // 6
Please note: these methods do not look for the number of occurrences, but only determine whether there is such a substring in the string or not.

To remove a substring, you can use the Remove(Int32, Int32) method - it removes the substring from the first specified index to the second.
string welcome = "Hello world! Goodbye world!";
string cut = welcome.Remove(1, 3); // "Ho world! Goodbye world!"

Problem

You are given a string in which the letter h  occurs at least twice. Remove the first and last occurrences of  h from this string, as well as all characters between them.

Input: a string is entered.
Output: print the answer to the problem.

Example.

Input Output
In the hole in the ground there lived a hobbit In tobbit