How to split a string in C++?

Python. How to string.split and sort a dictionary.?

  • I'm not sure where to begin here. I have a text-file and I want to split it, add it to a dictionary and then sort it. Do you have any pointers and examples that I can look at? ...show more

  • Answer:

    words = open( 'textfile.txt' ).read( ).split( ) words.sort() if the file has words followed by definitions then the code would have 2 or 3 more lines to create a (python) dictionary. But one would need more details on the file format.

I76L4H3JCTHONW3YJHSTIV5YRM at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.