Please, can you help me how to remove the strings [closed]


This Content is from Stack Overflow. Question asked by and

I have a string like examples_data123555.
How can I remove ata123555 from the string while leaving the exemple_d ?
P.S. I mention that I have dynamic data from a database.
In the database, the information is entered like this:

  • exemple_data123
  • str44_abcdef
  • exemple4_123444
  • model_1222

I need to extract from the database strings like:

  • exemple_d
  • str44_a
  • exemple4_1
  • model_1


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?