def ft_find_str(str1, str2): if str2 in str1: for i in range(l.ft_len(str1)): for j in str2: if str1[i] == j: if str1[i:l.ft_len(str2) + i] == str2: return i return -1
def ft_slice_str(str, start, end): otv = "" if end > l.ft_len(str): for i in range(start - 1, l.ft_len(str)): otv += str[i] return otv for i in range(start - 1, end): otv += str[i] return otv
def ft_find_str(st1, st2): len1 = ft_len(st1) len2 = ft_len(st2) cop = '' if st1 not in st2: return -1 else: for i in range(len2 - len1): for k in range(i, i + len1): cop += st2[k] if cop == st1: return i cop = ''
def ft_even_place(st): kol = ft_len(st) out = '' for i in range(kol): if i % 2 != 0 and i != 0: out += st[i] return out
def ft_cmp_str(st1, st2, x): res = '' for i in range(ft_len(st1)): if i == x - 1: res += st2 res += st1[i] return res
def ft_cmp_str(str1, str2, num): otv = '' for i in range(num - 1): otv += str1[i] otv += str2 for i in range(num - 1, l.ft_len(str1)): otv += str1[i] return otv
def ft_first_end_three(x): kol = ft_len(x) fd = '' if kol < 5: for i in range(kol): return x[0] else: fd = fd + x[0] + x[1] + x[2] + x[-3] + x[-2] + x[-1] return fd
def ft_slice_str(a, b, c): n = ft_len.ft_len(a) d = "" if n > c: for i in range(n): if i + 1 > b and i + 1 < c: d += a[i] else: for i in range(n): if i + 1 > b: d += a[i] return d
def ft_first_end_three(a): b = ft_len.ft_len(a) c = "" d = "" if b > 5: for i in range(3): c += a[i] d += a[-(3 - i)] print(c, f"\n{d}") else: for i in a: print(a[0])
def ft_reverse_str(str): otv = "" for i in range(-1, -l.ft_len(str) - 1, -1): otv += str[i] return otv
def ft_equal_reverse(a): n = ft_len.ft_len(a) for i in range(n // 2): if a[i] != a[-(i + 1)]: return "false" return "true"
def ft_even_place(str): a = "" for i in range(lenn.ft_len(str)): if i % 2 == 1: a += str[i] return a
def ft_first_end_three(a): if lenn.ft_len(a) > 5: return a[0] + a[1] + a[2] + a[-3] + a[-2] + a[-1] return a[0] * lenn.ft_len(a)
def ft_reverse_str(x): res = '' for i in range(ft_len(x)): res += x[(i + 1) * -1] return res
def ft_reverse_str(a): b = "" for i in range(ft_len.ft_len(a), 0, -1): b += a[i - 1] return b