Last active
September 2, 2017 13:40
Star
You must be signed in to star a gist
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
import org.junit.Test; | |
import static org.hamcrest.CoreMatchers.is; | |
import static org.junit.Assert.assertThat; | |
public class StringTest { | |
@Test | |
public void should_format_string() { | |
String formattedString = String.format("%s, %s, %s.", "a", "b", "c"); | |
assertThat(formattedString, is("a, b, c.")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html