Skip to content

Commit e7d5324

Browse files
author
Yalun Qin
committed
Add testParsing to TestStringf
1 parent eef6615 commit e7d5324

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

TestString.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ private static void testSubstring() {
107107
System.out.println("5, : " + s.substring(5));
108108
}
109109

110+
private static void testParsing() {
111+
String s = "104"; //Throw error if there are blanks in the string
112+
System.out.println(Integer.parseInt(s));
113+
}
114+
110115
public static void main(String[] args) {
111116
stringDemo();
112117
System.out.println("");
@@ -115,5 +120,6 @@ public static void main(String[] args) {
115120
testOtherMethods();
116121
testTrimming();
117122
testSubstring();
123+
testParsing();
118124
}
119125
}

0 commit comments

Comments
 (0)