Java tutorial
//package com.java2s; public class Main { public static String parseNick(String text) { int first = text.indexOf("<"); int last = text.indexOf(">"); if (first == -1 || last == -1) { return null; } String nick = text.substring(text.indexOf("<") + 1, last); return nick; } }