Skip to content

Tag: string

How to sort the contents of a list?

I have the following list: I need to make a list of book titles ordered by year, with the underscore character and the year removed. For example, the first book title should be “SecretOfChimneys”. Call your list booktitles. Is there a way to use the fact that titles are already sorted by year in b…

Best practice when substring is missing from string

I’m extracting data from an API and one of the fields is a string from which i want to extract multiple substrings(7 ideally). To get those substring I’m using the index() method. There could be cases when one or more of these substrings(Reason ,Improvements_Done, Improvements_Planned etc) could b…