Java Array Index Of arrayIndexClean(String indx)

Here you can find the source of arrayIndexClean(String indx)

Description

array Index Clean

License

Open Source License

Declaration

public static String arrayIndexClean(String indx) 

Method Source Code

//package com.java2s;
/* //from w w w .  java 2 s . com
 *  Copyright (C) 2000 - 2008 TagServlet Ltd
 *
 *  This file is part of Open BlueDragon (OpenBD) CFML Server Engine.
 *  
 *  OpenBD is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  Free Software Foundation,version 3.
 *  
 *  OpenBD 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 General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with OpenBD.  If not, see http://www.gnu.org/licenses/
 *  
 *  Additional permission under GNU GPL version 3 section 7
 *  
 *  If you modify this Program, or any covered work, by linking or combining 
 *  it with any of the JARS listed in the README.txt (or a modified version of 
 *  (that library), containing parts covered by the terms of that JAR, the 
 *  licensors of this Program grant you additional permission to convey the 
 *  resulting work. 
 *  README.txt @ http://www.openbluedragon.org/license/README.txt
 *  
 *  http://www.openbluedragon.org/
 */

public class Main {
    public static String arrayIndexClean(String indx) {
        if (indx.length() >= 2 && indx.charAt(0) == '\"' && indx.charAt(indx.length() - 1) == '\"')
            return indx.substring(1, indx.length() - 1);
        else
            return "#" + indx + "#";
    }
}

Related

  1. arrayIndex(T[] arr, T item)
  2. arrayIndexCheck(char[] text, int startPos, int endPos)
  3. arrayIndexFor(final String raw)
  4. ArrayIndexOf(byte[] data, byte[] dest)
  5. arrayIndexOf(int needle, int[] haystack)
  6. arrayIndexOf(int value, int[] arr)