如何删除两个句子之间的空格?

时间:2016-06-30 12:16:31

标签: python python-2.7 python-3.x

示例输入文件包含三个句子,如下所示:

I am learning python.


I have too remove spaces between sentences in file.


How to do that,thankyou.

输出应为:

I am learning python.
I have to remove spaces between sentences in file.
How to do that,thankyou.

1 个答案:

答案 0 :(得分:1)

public final class User {
    public init(firstName: String, lastName: String) {
        self.firstName = firstName
        self.lastName = lastName
    }
    public var firstName: String
    public var lastName: String
    public internal(set) var id: Int
}


protocol ActiveRecord {
    static func create(object: Self) throws -> Self
    static func fetch(id: Int) throws -> Self
    static func update(object: Self) throws -> Self
    static func delete(id: Int) throws 
}

extension User: ActiveRecord {
    static func create(object: User) throws -> User {
        ...
    }
    static func fetch(id: Int) throws -> User {
        ...
    }
    static func update(object: User) throws -> User {
        ...
    }
    static func delete(id: Int) throws {
        ...
    } 
}