'common_module.py' を更新

This commit is contained in:
2023-12-07 12:38:51 +09:00
parent cbc5f39bff
commit ea2d86e9a7
+3 -3
View File
@@ -12,8 +12,8 @@ class CommonModule:
@classmethod @classmethod
def index_by_f2c (cls, string: str, index: float) -> int: def index_by_f2c (cls, string: str, index: float) -> int:
i = 0 i: int = 0
work = '' work: str = ''
for c in string: for c in string:
work += c work += c
if cls.len_by_full (work) > index: if cls.len_by_full (work) > index:
@@ -25,7 +25,7 @@ class CommonModule:
@classmethod @classmethod
def mid_by_full (cls, string: str, start: float, length: float) -> str: def mid_by_full (cls, string: str, start: float, length: float) -> str:
trimmed_left = string[cls.index_by_f2c (string, start):] trimmed_left: str = string[cls.index_by_f2c (string, start):]
return trimmed_left[:cls.index_by_f2c (trimmed_left, length)] return trimmed_left[:cls.index_by_f2c (trimmed_left, length)]