Java String Chop ChopRt(String this_string, String chomp_off)

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

Description

Chop Rt

License

Open Source License

Declaration

static public String ChopRt(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 ChopRt(String this_string, String chomp_off) {
        if (!this_string.contains(chomp_off))
            return this_string;
        return this_string.substring(0, this_string.lastIndexOf(chomp_off));
    }//from   ww w.  ja  v  a 2s.  c o m

    static public String ChopRt(String this_string, String chomp_off, Integer times) {
        if (times == 1)
            return ChopRt(this_string, chomp_off);
        return ChopRt(this_string, chomp_off, times - 1);
    }
}

Related

  1. chopLast(String value, int chars)
  2. chopLenghtyString(String title, int maxLen)
  3. chopLongLinesAtSpaces(int maxLineLenght, String text)
  4. chopNull(String str)
  5. chopPrefix(String x, String prefix)
  6. chopScheme(String path)
  7. chopScheme(String path)
  8. chopString(String argString, int argLength)
  9. chopString(String str, int len)