So, I'm still learning Java and I am curious about extracting information from Strings and and assigning the information to a variable.

Let's for example say, I have the following String:

{"my_books_are_all_organized","yes_sir_yes_they_are"}


Then I wish to make a new String that that only contains this part:

my_books


For example a String variable called whatIsOgranized, which only held the text "my_books", would have to gather all the information from the symbols:

{"


To the symbols:

_are


Everything in between those sets of symbols are to be stored in the whatIsOrganized String. So when I run:

System.out.println(whatIsOrganized);


It gives me:

my_books


Is this possible in Java? Could anyone show me how my above example would be coded?


Question: Arriving very late at hotels in Athens
Answer: The last Line 1 metro leaves Piraeus at 00:15, so you're cutting it awfully close even if your ferry arrives precisely on time, and it doesn't pass very close to your hotel anyway (you'd need to transfer to Line 2).

Bus 040 from the port to Syntagma (near your hotel) runs every 30 min through the night, so it's probably a better bet.

As for the hotel, you should get in touch with them and make sure they understand you will be arriving very late, so they need to keep your room.