Java String Truncate Truncate(String v, int length)

Here you can find the source of Truncate(String v, int length)

Description

Truncate

License

Open Source License

Declaration

public static String Truncate(String v, int length) 

Method Source Code

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

public class Main {
    public static String Truncate(String v, int length) {
        return v.substring(0, Math.min(v.length(), length));

    }/*w w  w  .  ja  va  2s .  c om*/
}

Related

  1. truncate(String text, int maxLength)
  2. truncate(String text, int size, String charsetName)
  3. truncate(String text, int truncatedLength)
  4. truncate(String toTruncate, int maxSize)
  5. truncate(String url, int offset, int size)
  6. truncate(String val, int maxlen)
  7. truncate(String value, int length)
  8. truncate(String value, int length)
  9. truncate(String value, int length)