Manipulating Strings
1 posts in topic
Flat View  Flat View

Posted By:   sahil_k
Posted On:   Friday, August 23, 2002 01:01 PM

I am writing code that has to extract certain numbers from file names. The problem with the file names is that the numbers can appear anywhere in the filename.

Ex: 123456java.doc I have to extract the 123456. This case is easy.

Ex: ja123456va.doc or

Ex: java123456.doc

The common part of all this is that the numbers are in a group of 6. Is there a way to identify numbers that are 6 together and then extract them.


Re: Manipulating Strings

Posted By:   Jeanne_Boyarsky  
Posted On:   Friday, August 23, 2002 01:25 PM

If you're using java 1.4, you can use regular expressions to do this.

Otherwise, you'll have to do it manually (search for a digit and check the characters after it)
About | Sitemap | Contact