Java String Sub String substringBaseName(String baseName, int extraCharsNumber)

Here you can find the source of substringBaseName(String baseName, int extraCharsNumber)

Description

substring Base Name

License

Open Source License

Declaration

private static String substringBaseName(String baseName, int extraCharsNumber) 

Method Source Code

//package com.java2s;
/**//from   w w  w  .  ja  v a2s .  c o  m
 *     This file is part of the Squashtest platform.
 *     Copyright (C) 2010 - 2016 Henix, henix.fr
 *
 *     See the NOTICE file distributed with this work for additional
 *     information regarding copyright ownership.
 *
 *     This is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     this software is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this software.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    private static String substringBaseName(String baseName, int extraCharsNumber) {
        baseName = baseName.substring(0, baseName.length() - extraCharsNumber - 3) + "...";
        return baseName;
    }
}

Related

  1. substringAfterLast(String text, char after)
  2. subStringAfterLastSymbol(String inStr, char symbol)
  3. substringAfterReturnAll(String str, String before)
  4. substringAndchopLastNewline(String text, int start_pos, int end_pos)
  5. subStringArray(String in[], int start, int end)
  6. substringBefore(final String str, final String separator)
  7. substringBefore(final String string, final String separator)
  8. substringBefore(String input, String sub)
  9. substringBefore(String s, char c)