unit test & packages
This commit is contained in:
parent
3e595922e6
commit
abe38e8416
14 changed files with 70 additions and 1 deletions
Binary file not shown.
BIN
Code/Steiner/packagesStuff/bin/tech/photofuel/util/Txt.class
Normal file
BIN
Code/Steiner/packagesStuff/bin/tech/photofuel/util/Txt.class
Normal file
Binary file not shown.
BIN
Code/Steiner/packagesStuff/src/App.class
Normal file
BIN
Code/Steiner/packagesStuff/src/App.class
Normal file
Binary file not shown.
|
@ -1,5 +1,8 @@
|
|||
public class App {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("Hello, World!");
|
||||
// System.out.println(Txt.Left("Hello World", 5));
|
||||
// System.out.println(Txt.Left("Hello World", -2));
|
||||
// System.out.println(Txt.Left("Hello World", 122));
|
||||
// System.out.println(Txt.Left("Hello World", 0));
|
||||
}
|
||||
}
|
||||
|
|
BIN
Code/Steiner/packagesStuff/src/tech/photofuel/util/Txt.class
Normal file
BIN
Code/Steiner/packagesStuff/src/tech/photofuel/util/Txt.class
Normal file
Binary file not shown.
16
Code/Steiner/packagesStuff/src/tech/photofuel/util/Txt.java
Normal file
16
Code/Steiner/packagesStuff/src/tech/photofuel/util/Txt.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package tech.photofuel.util;
|
||||
|
||||
public class Txt {
|
||||
public static String Left(String text, int anzahlZeichen) {
|
||||
try {
|
||||
if (text.length() < anzahlZeichen) {
|
||||
return text;
|
||||
} else {
|
||||
return text.substring(0, anzahlZeichen);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("Invalid input error: " + e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue