示例#1
0
char	*my_strcapitalize(char *str)
{
  int	i;

  i = 0;
  if (!str)
    {
      return (0);
    }
  my_strlowcase(str);
  while (str[i] != '\0')
    {
      if (i > 0)
	{
	  if (!my_is_alphanum(str[i - 1]) && my_is_lower(str[i]))
	    {
	      str[i] = str[i] - ('a' - 'A');
	    }
	}
      else if (my_is_lower(str[i]))
	{
	  str[i] = str[i] - ('a' - 'A');
	}
      i = i + 1;
    }
  return (str);
}
示例#2
0
int		my_show_wordtab(char **tab)
{
  int		i;

  i = 0;
  while (tab[i])
    {
      my_putstr(tab[i]);
      if (my_is_alphanum(tab[i][0]))
	my_putchar('\n');
      i++;
    }
  return (0);
}