Java String Translate translate(String[] ids, String alias)

Here you can find the source of translate(String[] ids, String alias)

Description

Checks if the id is a substring of the alias

License

Open Source License

Parameter

Parameter Description
ids the ids
alias the alias

Return

the string

Declaration

private static String translate(String[] ids, String alias) 

Method Source Code

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

public class Main {
    /**/*from w w  w . jav a2  s  .co  m*/
     * Checks if the id is a substring of the alias
     * 
     * @param ids the ids
     * @param alias the alias
     * 
     * @return the string
     */
    private static String translate(String[] ids, String alias) {
        if (ids != null) {
            for (String id : ids) {
                if (id.indexOf(alias) != -1) {
                    return id;
                }
            }
            return null;
        }
        return alias;
    }
}

Related

  1. translate(String source)
  2. translate(String str, String searchChars, String replaceChars)
  3. translate(String str, String searchChars, String replaceChars)
  4. translate(String str, String searchChars, String[] replaceStrings)
  5. translate(String str, String string_in, String string_out)
  6. translate(StringBuffer sb, CharSequence from, CharSequence to)