Android String Sub String Get subString(String str)

Here you can find the source of subString(String str)

Description

sub String

Declaration

public static String subString(String str) 

Method Source Code

//package com.java2s;

import android.text.Html;

public class Main {
    static String E1 = "[\u4e00-\u9fa5]";

    public static String subString(String str) {
        str = Html.fromHtml(str, null, null).toString();
        String temp = String.valueOf(str.charAt(str.length() - 1));
        if (temp.matches(E1)) {
            return str.substring(0, str.length() - 2);
        }//w w w  .  j  a va  2s .  c  om
        return str.substring(0, str.length() - 1);
    }
}

Related

  1. subStringByByte(String paramString, int beginIndex, int endIndex)
  2. subString(String source, String start, int offsetStart, String end, int offsetEnd)
  3. subString(String str, int length)
  4. subInStringByFlag(String str, String flag)
  5. substringWithoutException(String text, int startIndex, int endIndex)
  6. replace(String s, String oldSub, String newSub)
  7. replace(String s, String[] oldSubs, String[] newSubs)
  8. substring(String str, int beginIndex)
  9. substring(String str, int beginIndex, int endIndex)