Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static String getWithMK(String str) { if (TextUtils.isEmpty(str)) return null; int index = str.indexOf("@mk"); if (index == -1) return str + "@mk"; return str.substring(0, index + 3); } }