Forums Register Login

Filter filename

+Pie Number of slices to send: Send
how can i filter the filenames before first dot in the filename with regex? i got the filename earlier with such a line:


now i need to get the filename for example:from filename1.data.txt only the filename1. How can i do it?
+Pie Number of slices to send: Send
 

how can i filter the filenames before first dot in the filename with regex? i got the filename earlier with such a line:


now i need to get the filename for example:from filename1.data.txt only the filename1. How can i do it?



The String.indexOf and String.substring methods together can accomplish this.
+Pie Number of slices to send: Send
Another option is
1
+Pie Number of slices to send: Send
or

which will remove everything after and including the first '.' .
+Pie Number of slices to send: Send
thank you it works
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 556 times.
Similar Threads
display hierachy tree in JSP
java.io.NotSerializableException when overwrite the JTable data into .txt file
java.io.ioException
StringTokenizer(read from text File) help needed
Write a program that merges two files containing alphabetized lists of student records into a single
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:43:23.