Here you can find the source of ChopAllLf(String this_string, String chomp_off)
static public String ChopAllLf(String this_string, String chomp_off)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may public class Main { static public String ChopAllLf(String this_string, String chomp_off) { if (!this_string.contains(chomp_off)) return this_string; return ChopLf(this_string, chomp_off, SeekRt(this_string, chomp_off.charAt(0)) + this_string.length() + 1); }//from w w w.j a v a 2 s . c o m static public String ChopLf(String this_string, String chomp_off) { if (!this_string.contains(chomp_off)) return this_string; return this_string.substring(SeekLf(this_string, chomp_off.charAt(0)) + 1, this_string.length()); } static public String ChopLf(String this_string, String chomp_off, Integer times) { if (times == 1) return ChopLf(this_string, chomp_off); return ChopLf(this_string, chomp_off, times - 1); } static private int SeekRt(String this_string, char c) { for (int i = -1; i + this_string.length() != 0; i--) { if (this_string.charAt(i) == c) return i; } return -1; } static private int SeekLf(String this_string, char c) { for (int i = 0; i < this_string.length(); i++) { if (this_string.charAt(i) == c) return i; } return -1; } }