Java String Trim Right rtrim(String s, char character)

Here you can find the source of rtrim(String s, char character)

Description

rtrim

License

Open Source License

Declaration

public static String rtrim(String s, char character) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String rtrim(String s, char character) {
        int i = s.length() - 1;
        while (i >= 0 && (s.charAt(i)) == character) {
            i--;/*from   w w  w  .  ja  v a 2  s  .c  om*/
        }
        return s.substring(0, i + 1);
    }
}

Related

  1. rtrim(String s)
  2. rtrim(String s)
  3. rtrim(String s)
  4. rtrim(String s)
  5. rTrim(String s)
  6. rtrim(String s, char character)
  7. rtrim(String s, Character c)
  8. rtrim(String source)
  9. rtrim(String source)