Spaces:
Runtime error
Runtime error
Create TextUtils.java
Browse files- TextUtils.java +17 -0
TextUtils.java
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// TextUtils.java
|
| 2 |
+
public class TextUtils {
|
| 3 |
+
public static String processText(String input) {
|
| 4 |
+
// Example transformation: trimming whitespace
|
| 5 |
+
return input.trim();
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
public static void main(String[] args) {
|
| 9 |
+
// Check if an argument is provided
|
| 10 |
+
if (args.length > 0) {
|
| 11 |
+
String result = processText(args[0]);
|
| 12 |
+
System.out.println(result); // Output the processed text
|
| 13 |
+
} else {
|
| 14 |
+
System.out.println("No input provided.");
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
}
|