| /******************************************************************************* |
| * Copyright (c) 2000, 2004 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Common Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/cpl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ltk.internal.ui.refactoring.util; |
| |
| |
| /** |
| * Helper class to provide String manipulation functions not available in standard JDK. |
| */ |
| public class Strings { |
| |
| private Strings(){} |
| |
| public static String removeNewLine(String message) { |
| StringBuffer result= new StringBuffer(); |
| int current= 0; |
| int index= message.indexOf('\n', 0); |
| while (index != -1) { |
| result.append(message.substring(current, index)); |
| if (current < index && index != 0) |
| result.append(' '); |
| current= index + 1; |
| index= message.indexOf('\n', current); |
| } |
| result.append(message.substring(current)); |
| return result.toString(); |
| } |
| } |
| |