Here you can find the source of left(String s, int size)
Parameter | Description |
---|---|
s | the string to be segmented |
size | the size of the left segment to be returned |
public static String left(String s, int size)
//package com.java2s; public class Main { /**//from w ww.j av a2 s .c o m * Basic-like Left$ function. * @param s the string to be segmented * @param size the size of the left segment to be returned * @return the size-most left characters. */ public static String left(String s, int size) { return s.substring(0, Math.min(size, s.length())); } }