How do I get what's inbetween “ ” in a user inputted String? Java

后端 未结 6 1580
清酒与你
清酒与你 2021-01-26 13:58

I\'d like to retrieve whatever is in quotes that someone enters as a string, i\'m assuming it\'s substring that I need but i\'m not sure how.

When the user inputs a stri

6条回答
  •  再見小時候
    2021-01-26 14:52

    Iterate over the string and use a temporary int variable to store when the quoted string started. When you see that it ends, you can extract that substring and do what you want with it.

提交回复
热议问题