feat:截断过早的超长消息,防止神秘破限词
This commit is contained in:
16
scripts/count.py
Normal file
16
scripts/count.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def 计算字符串长度(输入字符串: str) -> int:
|
||||
"""计算输入字符串的长度
|
||||
|
||||
参数:
|
||||
输入字符串: 要计算长度的字符串
|
||||
|
||||
返回:
|
||||
字符串的长度(整数)
|
||||
"""
|
||||
return len(输入字符串)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 测试代码
|
||||
测试字符串 = '''你。'''
|
||||
print(f"字符串 '{测试字符串}' 的长度是: {计算字符串长度(测试字符串)}")
|
||||
|
||||
Reference in New Issue
Block a user