0

Suppose I have two text files.

The first one, called reference.txt has the following content:

dog goat cat

The second one, called compare.txt has the following content:

cow goat cockroach

I want to compare each character in the 1st and 2nd text files and ignore the whitespace. I've been working it for weeks!

Hope anyone can help me out please. Just give an idea, sure it will be enough for me

Thanks

4

1 に答える 1

0

空白を無視して比較を行うことを考えているだけの場合。一般的な手順は次のとおりです。

  1. 最初のファイルの内容を

  2. 2 番目のファイルの内容を文字列に読み込む

  3. 両方の文字列からすべての空白を削除します (どのように? 理解するために残します)

  4. 比較してください。

自分で試してみたいとおっしゃっていたので、コードは提供されていません。

于 2011-03-21T05:41:01.090 に答える