Here you can find the source of replaceLineSeparatorInternal(String string, String lineSeparator)
Parameter | Description |
---|---|
string | - the string to be replaced |
lineSeparator | - line separator to be used in the string |
public static String replaceLineSeparatorInternal(String string, String lineSeparator)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009, 2013 Andrew Gvozdev (Quoin 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:// w w w.ja v a2 s . c om * Andrew Gvozdev (Quoin Inc.) *******************************************************************************/ public class Main { private static String LINE_SEPARATOR = System .getProperty("line.separator"); /** * <b>Do not use outside of CDT.</b> This method is a workaround for {@link javax.xml.transform.Transformer} * not being able to specify the line separator. This method replaces a string generated by * {@link javax.xml.transform.Transformer} which contains the system line.separator with the line separators * from an existing file or the preferences if it's a new file. * * @param string - the string to be replaced * @param lineSeparator - line separator to be used in the string * * @noreference This method is not intended to be referenced by clients. * This is an internal method which ideally should be made private. */ public static String replaceLineSeparatorInternal(String string, String lineSeparator) { string = string.replace(LINE_SEPARATOR, lineSeparator); return string; } }