Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

dart : how to get text till second underscore?

This is my key

pi_1DsTls2eZvKYlo2C3N1yynSw_secret_bTWD4Vz6X384KpcdeZV6uqlhy

from this key i eant to take only this with hard code

pi_1DsTls2eZvKYlo2C3N1yynSw

please help me, thank you

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

here a function you can use

    String getBeforeSecondUnderScore(String value) {
     return value.substring(
       0,
       value.indexOf(
         "_",
         value.indexOf("_") + 1,
       ),
     );
   }

in dart laungage since I found it with flutter tag filter

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading