From 3840659063e268253f8a27b1a7b08ad07a855043 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Wed, 7 Feb 2024 10:10:19 +0100 Subject: [PATCH] Added isNumber Method to Administration class --- src/main/java/org/example/Administration.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 4e4c4f7..c9e5d90 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -208,6 +208,22 @@ public class Administration { } } + public boolean isNumber(String substring) + { + if(substring == null || substring.isEmpty()) + { + return false; + } + for(char c : substring.toCharArray()) + { + if(!Character.isDigit(c)) + { + return false; + } + } + return true; + } + }