Here you can find the source of leftTrim(char[] text, int offset)
Parameter | Description |
---|---|
text | the scanned text |
offset | first character to inspect |
public static int leftTrim(char[] text, int offset)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w.j av a 2s .c o m * Return number of whitespace character from the offset to the first non * whitespace character. * * @param text * the scanned text * * @param offset * first character to inspect * * @return number of whitespaces or zero */ public static int leftTrim(char[] text, int offset) { int counter = 0; if (text != null && offset < text.length) { while (Character.isWhitespace(text[offset + counter])) { counter++; } } return counter; } }