Java String Chop ChopAllRt(String this_string, String chomp_off)

Here you can find the source of ChopAllRt(String this_string, String chomp_off)

Description

Chop All Rt

License

Open Source License

Declaration

static public String ChopAllRt(String this_string, String chomp_off) 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License"); you may

public class Main {
    static public String ChopAllRt(String this_string, String chomp_off) {
        if (!this_string.contains(chomp_off))
            return this_string;
        return this_string.substring(0, this_string.length() - SeekLf(this_string, chomp_off.charAt(0)));
    }//from  w w  w .j av  a 2  s  .  c  om

    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;
    }
}

Related

  1. chop(String x)
  2. chop(String[] arr, int pos)
  3. chop(StringBuffer buffer, int chars)
  4. chopAccelerator(final String title)
  5. ChopAllLf(String this_string, String chomp_off)
  6. chopBraces(String s)
  7. chopCommentFromArgs(String[] args)
  8. chopExt(String orig)
  9. chopFirstComponent(String s)