I want to remove a string i.e. [View Hierarchy] from string clientName[View Hierarchy].
Means I want only string clientName and [View Hierarchy] should be removed from last.
Also there should not be any space or character in Main string when we remove it.
Actual output should be- clientName