Here you can find the source of formatString(String format, String arg1)
public static String formatString(String format, String arg1)
//package com.java2s; /******************************************************************************* * Copyright (c) 2005, 2012 IBM Corporation and others. * 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:/*from ww w. j a v a 2s .co m*/ * IBM Corporation - initial API and implementation *******************************************************************************/ import java.text.MessageFormat; public class Main { /** * Convenience formatting methods. */ public static String formatString(String format, String arg1) { return MessageFormat.format(format, new Object[] { arg1 }); } public static String formatString(String format, String arg1, String arg2) { return MessageFormat.format(format, new Object[] { arg1, arg2 }); } }