Page 1 of 1
simple basic use
Posted: Mon Aug 04, 2008 12:45 am
by Nicholas Jordan
I need get-going help to replace nearly 300 lines like this:
Code: Select all
String Tokelau ="Overseas territory of New Zealand";//
With this:
*
Code: Select all
super.put(new String ("Tokelau"),new String("Overseas territory of New Zealand"));//
Or something close to that, this is tedious to do by hand.
I have tried thusfar to try to get going:
First form produces a find, I was trying to do capturing groups from Wiki description of regex. Am not making any progress, there may be one or two rounds to get me going. Spaces outside of quoted strings do not matter except between new and String
Posted: Mon Aug 04, 2008 5:00 am
by MudGuard
replace
by
Code: Select all
super.put(new String("\1"), new String("\2"));
Btw, are you sure you want to have new String("bla") instead of just "bla"? In Java (and your sample looks like Java) it is not necessary.
making a TreeMap of Country Names / Longer String
Posted: Mon Aug 04, 2008 4:23 pm
by Nicholas Jordan
MudGuard wrote:.....Btw, are you sure you want to have new String("bla") instead of just "bla"? In Java (and your sample looks like Java) it is not necessary.
Will try your code momentarily, client wants to see what I have recently.
{ message edit: it worked!
}
Code: Select all
super.put(new String("Tuvalu"), new String("Ellice Islands"));//
What this is:
Writing Java, a plug-in for a server written almost entirely in Java running well designed apps that talk to client written in Java. All looks really nice and is well done work. Spec list includes providing dropdown list of country names for end-use html so that average customer may select what country from in html writtten to browser.
I already had list of String / country prototyped in Java, had previously setteled on the design of making class a TreeMap (extends TreeMap) Thus, in the constructor I can do super.put( new String, new String ); and have the list of country names available as an enumeration of keys. This would be handy since the entire environment is totally Java anyway: I could just do PageBuffer.append() html select and feed it the Enumeration as however you get Strings back out of an Enumeration,....First I needed to get the sources into shape.