Files
spring-boot-rest/libraries-3/src/main/java/com/baeldung/cactoos/CactoosStringUtils.java
Paturi Radhe Sravan f83994f516 BAEL-3597 Cactoos (#8512)
* BAEL-3597 Cactoos

* BAEL-3597 Cactoos

* BAEL-3597 Cactoos

* BAEL-3597 Cactoos
2020-01-14 09:04:07 -08:00

38 lines
1.0 KiB
Java

package com.baeldung.cactoos;
import java.io.IOException;
import org.cactoos.text.FormattedText;
import org.cactoos.text.IsBlank;
import org.cactoos.text.Lowered;
import org.cactoos.text.TextOf;
import org.cactoos.text.Upper;
public class CactoosStringUtils {
public String createString() throws IOException {
String testString = new TextOf("Test String").asString();
return testString;
}
public String createdFormattedString(String stringToFormat) throws IOException {
String formattedString = new FormattedText("Hello %s", stringToFormat).asString();
return formattedString;
}
public String toLowerCase(String testString) throws IOException {
String lowerCaseString = new Lowered(new TextOf(testString)).asString();
return lowerCaseString;
}
public String toUpperCase(String testString) throws Exception {
String upperCaseString = new Upper(new TextOf(testString)).asString();
return upperCaseString;
}
public boolean isBlank(String testString) throws Exception {
return new IsBlank(new TextOf(testString)) != null;
}
}