Java tutorial
//package com.java2s; public class Main { public static String cleanAvatarPath(String path) { String avatarPath; try { avatarPath = path.substring(0, path.indexOf("?")); } catch (Exception e) { avatarPath = "Failure on clear avatar path"; } return avatarPath; } }