在c#中将文本文件解析为字典

时间:2017-03-02 05:39:09

标签: c# regex

如何逐行读取文本文件并将:sometext:行转换为字典的键,然后放在:somtext:行到字典的值?例如,我如何制作以下新行分隔列表:

我的文字档案:

:II: Own BIC / TID
COBADEFFDOC BIC could not be resolved
:IO: Correspondents BIC / TID
abc BIC identified as:
xyz AG,THE,pqe BRANCH
zxc

输出:

dictionary key ->  :II:
dictionary value ->  Own BIC / TID COBADEFFDOC BIC could not be resolved


dictionary key ->  :IO:
dictionary value ->  Correspondents BIC / TID
                             abc BIC identified as:
                              xyz AG,THE,pqe BRANCH
                              zxc

提前致谢。

1 个答案:

答案 0 :(得分:1)

我已经尝试过并且几乎正常工作......就像这样...

declare module "react-summernote" {
    import * as React from "react";
    let ReactSummernote: React.ComponentClass<any>;
    export default ReactSummernote;
}