public static String trimFromLast(String str, String stripString) {int pos = str.lastIndexOf(stripString);if (pos > -1) {return str.substring(0, pos);} else {return str;}}

public static string TrimFromLast(string str, string stripString){var pos = str.LastIndexOf(stripString);if (pos > -1){return str.Substring(0, pos);}return str;}
