https://github.com/saksham-joshi/modern-string
Highly optimized implementation of string in C with 48+ functions for manipulation.
https://github.com/saksham-joshi/modern-string
c-language c-library string-manipulation
Last synced: 11 months ago
JSON representation
Highly optimized implementation of string in C with 48+ functions for manipulation.
- Host: GitHub
- URL: https://github.com/saksham-joshi/modern-string
- Owner: saksham-joshi
- Created: 2025-01-06T07:14:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-16T15:58:44.000Z (11 months ago)
- Last Synced: 2025-02-16T16:41:57.586Z (11 months ago)
- Topics: c-language, c-library, string-manipulation
- Language: C
- Homepage:
- Size: 26.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🔠Modern String in C
- This is a package which contains implementation of string in C language.
- It provides several optimized functions written in C.
- It is simple and easy to use.
- It matches the speed and efficiency of **'std::string'** from C++.
- Takes only 24 bytes of memory in x64 architecture.
## How to use it?
- **Step 1**: Copy this whole repo to your project's directory.
- **Step 2**: Include 'String.h' file in your code like this:
```c
#include "Modern_String/Modern_String.h"
```
- **Step 3**: To create a String, below is an example:
```c
#include "Modern_String/Modern_String.h"
int main(void)
{
ModernString str = makeString("Hello, World");
printString(&str);
destroyString(&str); // destruction is important
return 0;
}
```
#### **NOTE**: Don't create instance of '**struct String**' directly. Instead, call '**makeString()**' functions which is as fast as creating an instance directly and it performs additional settings to make your string work stable.
## 🎹 Coding Convention
```
Functions - camelCase ending with word 'String'.
Function Parameters - smallcase starting with '__'
Local Variables - lowercase
Global Variables/constants - UPPER_CASE
typedef/structs/types - PascalCase
struct members - smallcase starting with underscore
File names - Capitalized seperated by underscore
```
## 🔗 Developer Links
[](https://sakshamjoshi.netlify.app/)
[](https://www.linkedin.com/in/sakshamjoshi27)
[](https://github.com/saksham-joshi)
[](https://x.com/sakshamjoshi27)
[](mailto:social.sakshamjoshi@gmail.com)