From cc0701d408ced18af68f26fa267b3f8945db5562 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 29 Oct 2023 06:57:18 -0400 Subject: [PATCH] Implemented new function... --- xtandard.c | 18 ++++++++++++++++++ xtandard.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/xtandard.c b/xtandard.c index 80be2b9..c470b31 100644 --- a/xtandard.c +++ b/xtandard.c @@ -698,6 +698,24 @@ int string_split_space (char * string) { return (++count); } +char * string_realign (char * string, int amount, char character) { + int offset, length; + + length = string_length (string); + + for (offset = 0; offset != length; ++offset) { + string [amount - offset - 1] = string [length - offset - 1]; + } + + for (offset = 0; offset != amount - length; ++offset) { + string [offset] = character; + } + + string [amount] = '\0'; + + return (string); +} + void memory_delete (void * memory, int length) { int i = 0; diff --git a/xtandard.h b/xtandard.h index 8e429d9..482aa21 100644 --- a/xtandard.h +++ b/xtandard.h @@ -121,6 +121,8 @@ extern char * string_concatenate_limit (char * string_0, char * string_1, int li extern int string_split_space (char * string); +extern char * string_realign (char * string, int amount, char character); + extern void memory_delete (void * memory, int length); extern int memory_compare (void * memory, void * source, int length);