← 返回 pinterest 的题目列表Class-based String Segmentation
类型:online_judge
Write a function that takes an instance of a pre-made class with a next() method. Each call to this next() method will return a string, and the string might include '//n' as line separators. Concatenate these fragments and correctly split them into lines based on the separator. Output a string representing each complete line, ensuring to account for line separators in the strings.
Example
Input
StringGenerator(["one//ntw", "o//n", "three//nfour", "//nfi", "ve"])