i want to write a line of code that could extract a text ending with the character " - "

example

flower - // the out put i want is also flower

in this text file there may be a lot text written in different formats, but i only want to extract the word ending with " - " as shown above..

some one please provide me with the code

Better you provide us with the code and we help to debug it...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.