Java tutorial
//package com.java2s; public class Main { public static String splitKeyWord(String data) { if (data == null || data.length() == 0) return null; if (data.lastIndexOf("@") == -1) return data; return data.substring(0, data.lastIndexOf("@")); } }