Here you can find the source of tail(final String text, final char ch)
Parameter | Description |
---|---|
text | a parameter |
ch | a parameter |
public static String tail(final String text, final char ch)
//package com.java2s; /*//from w w w .j a v a 2 s.com * Copyright (c) 2006 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ * * Contributors: * Stephan D. Cote * - Initial concept and implementation */ public class Main { /** * Return the string after the last occurance of the given character in the * given string. * * <p>Useful for getting extensions from filenames. Also used to retrieve the * last segment of an IP address.</p> * * @param text * @param ch * * @return TODO Complete Documentation */ public static String tail(final String text, final char ch) { final int indx = text.lastIndexOf(ch); return (indx != -1) ? text.substring(indx + 1) : text; } }