diff --git a/README.md b/README.md index 7d69023..ef404ea 100644 --- a/README.md +++ b/README.md @@ -1621,7 +1621,8 @@ import "github.com/duke-git/lancet/v2/strutil" [[play](https://go.dev/play/p/HzLC9vsTwkf)] - **SubInBetween** : return substring between the start and end position(excluded) of source string. [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#SubInBetween)] - +- **HammingDistance** : calculates the Hamming distance between two strings. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#HammingDistance)]
TBD
+计算两个字符串之间的汉明距离。汉明距离是指对应符号不同的位置数。
函数签名: diff --git a/docs/en/api/packages/strutil.md b/docs/en/api/packages/strutil.md index b184c45..676a8bd 100644 --- a/docs/en/api/packages/strutil.md +++ b/docs/en/api/packages/strutil.md @@ -1502,7 +1502,7 @@ func main() { ### HammingDistance -HammingDistance calculates the Hamming distance between two strings. The Hamming distance is the number of positions at which the corresponding symbols are different
+HammingDistance calculates the Hamming distance between two strings. The Hamming distance is the number of positions at which the corresponding symbols are different.
Signature: