Created
October 6, 2016 15:33
-
-
Save wingyplus/46c6bda185559c7df399c3d82e105c6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.wingyplus; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
/** | |
* Created by wingyplus on 10/6/2016 AD. | |
*/ | |
public class StringTest { | |
@Test | |
public void replaceCharacter() { | |
String s = "text^^after new line"; | |
String snew = s.replace(new StringBuffer("^^"), new StringBuffer("\n")); | |
assertEquals("text\nafter new line", snew); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment