Last active
August 29, 2015 14:15
-
-
Save mid0111/7707cdd5dc7c48a7dd5f to your computer and use it in GitHub Desktop.
Javaの制御コード話
This file contains hidden or 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
import static org.fest.assertions.Assertions.assertThat; | |
import org.apache.commons.lang.StringEscapeUtils; | |
import org.junit.Test; | |
public class Unescape { | |
@Test | |
public void convertUnescapedUnicodeString() { | |
String before = "abcd\\u0001efgh\\u0001"; | |
String after = StringEscapeUtils.unescapeJava(before); | |
System.out.println(after); | |
assertThat(after).isEqualTo("abcd\u0001"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment