1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/// Finds an exact [String] match within a source and a provided pattern
/// and returns the [usize] index pointing to where that pattern is first found.
///
/// Returns [None] if not found
///
/// Takes in:
/// [&str], [&str]
///
/// Outputs:
/// [usize]
///
/// # Examples
///
/// ```
/// use febits::prim_str::find_str_exact;
///
/// let input = "This is Test Data";
/// let pattern = "Test";
/// let index = find_str_exact(input, pattern);
/// assert_eq!(index, Some(8));
/// let index = find_str_exact("This is Test", "is Test");
/// assert_eq!(index, Some(5));
/// let index = find_str_exact("This is test", "Only a test");
/// assert_eq!(index, None);
/// ```
///
/// Finds a [String] match within a source and a provided pattern
/// and returns the [usize] index pointing to where that pattern is first found.
///
/// Returns [None] if not found.
///
/// Takes in:
/// [&str], [&str]
///
/// Outputs:
/// [usize]
///
/// # Examples
///
/// ```
/// use febits::prim_str::find_str;
///
/// let input = "THiS Is TeSt Data";
/// let pattern = "TeST";
/// let index = find_str(input, pattern);
/// assert_eq!(index, Some(8));
/// let index = find_str("ThIS iS tESt", "Is tEST");
/// assert_eq!(index, Some(5));
/// let index = find_str("This IS A teST", "JuSt A TeST");
/// assert_eq!(index, None);
/// ```
///