Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Firestar Software, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Firestar Software, Inc. - initial API and implementation * * Author: * Gabriel Oancea * *******************************************************************************/ public class Main { private static String[] parseAttrValue(String s) { if (s == null || s.length() <= 0 || !s.startsWith("@")) throw new IllegalArgumentException("Invalid argument expresion " + s); s = s.substring(1); int i = s.indexOf('='); String[] a = new String[2]; a[0] = s.substring(0, i); a[1] = s.substring(i + 2, s.length() - 1); return a; } }