-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_toupper.c
43 lines (38 loc) · 1.33 KB
/
ft_toupper.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yuske <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/20 19:57:12 by yuske #+# #+# */
/* Updated: 2023/04/01 08:58:50 by yuske ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief
*
* @param chr
* @return int
*/
int ft_toupper(int chr)
{
if (ft_islower(chr) != 0)
chr += ('A' - 'a');
return (chr);
}
// int ft_toupper(int chr)
// {
// return (chr + ('A' - 'a') * (ft_islower(chr)));
// }
// int ft_toupper(int chr)
// {
// return (chr + ('A' - 'a') * (chr >= 'a' && chr <= 'z'));
// }
// int ft_toupper(int chr)
// {
// if (chr >= 'a' && chr <= 'z')
// chr += ('A' - 'a');
// return (chr);
// }