Java String Chomp chomp(String in)

Here you can find the source of chomp(String in)

Description

chomp

License

Open Source License

Declaration

public static String chomp(String in) 

Method Source Code

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

public class Main {
    public static String chomp(String in) {
        if (in.endsWith("\r\n"))
            return in.substring(0, in.length() - 2);
        else if (in.endsWith("\n"))
            return in.substring(0, in.length() - 1);
        else//from  w w  w.  j a  v a2 s.  c  o  m
            return in;
    }
}

Related

  1. chomp(CharSequence prefix, CharSequence full)
  2. chomp(final String s, final String suffix)
  3. chomp(String inStr)
  4. chomp(String options)
  5. chomp(String path)
  6. chomp(String s)