Keeping the data in four separate files has some of the same issues as keeping them in four separate arrays: what if the file entries get out of sync? In situations like yours a typical file structure to store a list of some object type (e.g. IceCream) would be using comma separated values (CSV). Each row would represent a single object and each column would represent an attribute of that object. For IceCream it would look like:Barry's Boothang wrote: I've been working with a template for the project that has 4 files that just list data should I still take this approach?
Steve Dyke wrote:Sorry.
I was doing this:
Instead of this:
Steve Dyke wrote:Any character in the string that has a preceding space, I need to remove it.
Carey Brown wrote:
Campbell Ritchie wrote:What's wrong with substring()?
Steve Dyke wrote:I need it to return this:
System.out.println( trimPartNo( "41131001-299" ) );//Take out the "S"
System.out.println( trimPartNo( "41131001-299-101-AS" ) );