Reputation: 11
I have a string -
"126_VAMSI, SWAP L. NA_8092069876"
i need to get "VAMSI, SWAP L. NA" as an output i.e. the words between the underscore, then what should be my approach.
Upvotes: 0
Views: 44
Reputation: 656
If your question is complete and string only has two underscores and you want the middle text between underscores. Then this is your answer.
str.split("_")[1];
If your questioned string is variant pls elaborate
Upvotes: 2