Java String Truncate truncate(final String target, final int maxSize)

Here you can find the source of truncate(final String target, final int maxSize)

Description

truncate

License

Open Source License

Declaration

static final public String truncate(final String target, final int maxSize) 

Method Source Code

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

public class Main {
    static final public String truncate(final String target, final int maxSize) {
        return (target.length() > maxSize ? target.substring(0, maxSize) : target);
    }//from ww  w  . j a  va 2 s  .  c om
}

Related

  1. truncate(final String originalString, final int maxChars)
  2. truncate(final String s, final int n)
  3. truncate(final String str, final int len)
  4. truncate(final String str, final int len)
  5. truncate(final String str, final int maxWidth)
  6. truncate(final String value, final int width)
  7. truncate(Object truncateMe, int maxLength, String suffix)
  8. truncate(String eval, String suffix, int targetLength)
  9. truncate(String input, int maxLength)