Here you can find the source of chopFirstComponent(String s)
s
with the first component removed.
Parameter | Description |
---|---|
s | The string to consider |
public static String chopFirstComponent(String s)
//package com.java2s; public class Main { /**/* w w w . j a v a 2 s .c om*/ * Returns the string <code>s</code> with the first component removed. For example, * the input "v.p1r.log.uid" would produce the result "p1r.log.uid". If <code>s</code> * contains no "." characters, the argument <code>s</code> is returned. * * @param s * The string to consider * @return The part of s following the leftmost dot. */ public static String chopFirstComponent(String s) { int dotIx = s.indexOf('.'); return dotIx < 0 ? s : s.substring(1 + dotIx); } }