blob: c3e90855d7d3bb322333d7d956fdbdd3d950ce73 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2010 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ltk.internal.ui.refactoring.util;
/**
* Utility class for string-related functions.
*
* @since 3.0
*/
public final class Strings {
public static String removeNewLine(String message) {
final StringBuilder result= new StringBuilder();
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();
}
private Strings() {
// Not for instantiation
}
}