-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.cpp
More file actions
29 lines (25 loc) · 732 Bytes
/
string.cpp
File metadata and controls
29 lines (25 loc) · 732 Bytes
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
/*
@author Lite Systems: Blas
LitePlusPlus v_1.2
This file contains the things that you need to work with strings.
Lite Surface (c) 2023
*/
#include <iostream>
std::string add(std::string initialText, std::string text) {
return initialText += text;
}
std::string quitEnd(std::string initialText, int lenght) {
return initialText.substr(0, initialText.length() - lenght);
}
bool contains(char text[], char find[]) {
int index = 0;
for(int i = 0;i < sizeof(text) / sizeof(char); i++) {
if(text[i] == find[index]) {
index++;
if(index == sizeof(find) / sizeof(char)) {
return true;
}
}
}
return false;
}