I'm having a string "Kishore kumar karaoke tracks", from which I want to remove the substring 'karaoke tracks'. I want the output as 'Kishore kumar'.
For this purpose, I'm using the following line of code:
artist = artist.TrimEnd(new char[] {'k','a','r','a','o','k','e', ' ', 't','r','a','c','k','s'});
But, I'm getting the output as 'Kishore kum' i.e. i'm not getting the last 2 characters 'ar'.
Where I'm going wrong?