aboutsummaryrefslogtreecommitdiff
path: root/c02/ex08/ft_strlowcase.c
diff options
context:
space:
mode:
Diffstat (limited to 'c02/ex08/ft_strlowcase.c')
-rw-r--r--c02/ex08/ft_strlowcase.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/c02/ex08/ft_strlowcase.c b/c02/ex08/ft_strlowcase.c
new file mode 100644
index 0000000..1c7b56c
--- /dev/null
+++ b/c02/ex08/ft_strlowcase.c
@@ -0,0 +1,25 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strlowercase.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/03 19:53:41 by cacharle #+# #+# */
+/* Updated: 2019/07/05 09:10:17 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+char *ft_strlowcase(char *str)
+{
+ char *head;
+
+ head = str;
+ while (*str != '\0')
+ {
+ if (*str >= 'A' && *str <= 'Z')
+ *str = *str - 'A' + 'a';
+ str++;
+ }
+ return (head);
+}