You can use Patterns for example :

String str = "Niedersachsen,NOT IN CHARGE SINCE: 03.2009, CATEGORY";
Pattern p = Pattern.compile("\\d{2}\\.\\d{4}");
Matcher m = p.matcher(str);

if (m.find()) {
    System.out.println(m.group());
}

Output

03.2009

Note : if you want to get similar dates in all your String you can use while instead of if.


Edit

Or you can use :

String str = "Niedersachsen,NOT IN CHARGE SINCE: 03.03.2009, CATEGORY";
Pattern p = Pattern.compile("SINCE:(.*?)\\,");
Matcher m = p.matcher(str);

if (m.find()) {
    System.out.println(m.group(1).trim());
}
Answer from Youcef LAIDANI on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ ref_string_substring.asp
Java String substring() Method
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The substring() method returns a substring from the string.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java string โ€บ get substring from string in java
Get Substring from String in Java | Baeldung
July 21, 2024 - For more details on the Java regular expressions check out this tutorial. We can use the split method from the String class to extract a substring. Say we want to extract the first sentence from the example String.
Discussions

Get Substring from a String in Java - Stack Overflow
I have the following text: ...,Niedersachsen,NOT IN CHARGE SINCE: 03.2009, CATEGORY:..., Now I want to extract the date after NOT IN CHARGE SINCE: until the comma. So i need only 03.2009 as resul... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to extract specific parts of a string JAVA - Stack Overflow
The first thing I would do would be to look for an XML parser. However if this is all you need, use regular expressions or substring. ... .indexOf() in order to get the index of a given character. More on stackoverflow.com
๐ŸŒ stackoverflow.com
In java how to get substring from a string till a character c? - Stack Overflow
I have a string (which is basically a file name following a naming convention) abc.def.ghi I would like to extract the substring before the first . (ie a dot) In java doc api, I can't seem to fin... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to correctly use the substring method? (Java)
You are deeply confused about how substring() works - it's a method of String, and it does not take Strings as parameters. See here for an example. More on reddit.com
๐ŸŒ r/learnprogramming
5
5
February 2, 2013
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ substring-in-java
Java String substring() Method - GeeksforGeeks
April 11, 2025 - In Java, the substring() method of the String class returns a substring from the given string.
๐ŸŒ
BeginnersBook
beginnersbook.com โ€บ 2013 โ€บ 12 โ€บ java-string-substring-method-example
Java String substring() Method with examples
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex โ€“ 1. Thus the length of the substring is endIndex-beginIndex. Examples: โ€œhamburgerโ€.substring(4, 8) returns โ€œurgeโ€ โ€œsmilesโ€...
๐ŸŒ
How to do in Java
howtodoinjava.com โ€บ home โ€บ string โ€บ java string substring()
Java String substring() with Examples - HowToDoInJava
January 10, 2023 - String substring(int beginIndex) String substringโ€‹(int beginIndex, int endIndex) The method returns the substring between the valid start and end indices. If the indices are not valid then we can get IndexOutOfBoundsException error in the runtime.
๐ŸŒ
Simplilearn
simplilearn.com โ€บ home โ€บ resources โ€บ software development โ€บ all you should know about substring in java
All You Should Know About Substring in Java | Simplilearn
September 11, 2025 - Syntax : public String substring(int startIndex, int endIndex) Parameters: startIndex: the starting index, inclusive ... Return Value: Specified substring. ... Want a Top Software Development Job?
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
Find elsewhere
๐ŸŒ
CodeGym
codegym.cc โ€บ java blog โ€บ strings in java โ€บ substring in java
Java String substring()
July 23, 2024 - Java Substring in general is a contiguous sequence of characters inside the String. It could be a part of the String or the whole String as well. What is substring in Java? This language has a substring() method, or rather two methods, thanks to Java method overloading. You may use them to get substring in Java program.
๐ŸŒ
Programiz
programiz.com โ€บ java-programming โ€บ library โ€บ string โ€บ substring
Java String substring() | Programiz
January 31, 2024 - The Java substring() method extracts a part of the string (substring) and returns it.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ java โ€บ lang โ€บ string_substring.htm
Java - String substring() Method
package com.tutorialspoint; public ... substring = This is tutorials point ยท Following is an example to show the use of substring() method in Java by finding the substring of the provided string....
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ java โ€บ strings โ€บ .substring()
Java | Strings | .substring() | Codecademy
April 28, 2025 - The .substring() method in Java returns a portion of a string from a specified starting index to an (optional) ending index.
๐ŸŒ
HappyCoders
happycoders.eu โ€บ home โ€บ java โ€บ java substring() method: how to use it and how it works
Java substring() Method: How to Use It and How It Works
1 month ago - Experienced Java developers familiar ... Work in Java?โ€ section. The String.substring() method returns a substring of the original string, based on a beginning index and an ending index....
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ java-string-substring
Master Java Substring Method: Examples, Syntax, and Use Cases | DigitalOcean
February 20, 2025 - Learn how to use the Java substring method. Explore syntax, practical examples, and common errors to handle substrings effectively.
๐ŸŒ
JavaBeat
javabeat.net โ€บ use-string-substring-method-java
How to Use String substring() Method in Java
The substring() is a built-in method of Javaโ€™s standard String class. You can use/apply this method on any given string. As a result, it extracts and retrieves a substring(part of a string) according to the specified starting and ending indexes.
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ java โ€บ standard library โ€บ java โ€บ lang โ€บ string โ€บ substring()
Java String substring() - Extract Substring | Vultr Docs
January 1, 2025 - The substring() method in Java is available in two variations, each serving to extract parts of a string based on different sets of parameters:
๐ŸŒ
javathinking
javathinking.com โ€บ blog โ€บ get-substring-from-string-in-java
Get Substring from String in Java: A Comprehensive Guide โ€” javathinking.com
String.substring() creates a new String that (in Java 7+) has its own character array. For very large strings, excessive substring operations can cause memory issues.
๐ŸŒ
Edureka
edureka.co โ€บ blog โ€บ substring-in-java
Substring in Java | String substring() Method Example | Edureka
June 14, 2021 - A part of a string is called a Substring. In other words, substring is a subset of another string. The Java substring() method returns a new string that is a substring of this string.