Here you can find the source of truncateNumberSign(String s)
public static String truncateNumberSign(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static String truncateNumberSign(String s) { if (s.contains("#")) { int i = s.indexOf("#"); return s.substring(0, i); } else {//from ww w . j av a2s .com return s; } } }