0

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.

Swap
  • 11
  • 1

1 Answers1

2

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

ajaykumar
  • 646
  • 7
  • 17