StringTrimLeft

A função remove caracteres de quebra de linha, espaços e tabs na parte esquerda da string até o primeiro símbolo significativo. A string é modificada no lugar.

int  StringTrimLeft(
   string&  string_var      // string para cortar
   );

Parâmetros

string_var

[in][out]  String que será cortada a partir da esquerda.

Valor do Retorno

Retorna o número de símbolos removidos.

Exemplo:

void OnStart()
  {
//--- definimos uma string de origem com seis espaços no lado esquerdo da string
   string text="      All spaces on the left will be removed from this string";
//--- exibimos no log a string de origem
   PrintFormat("Source line:\n'%s'"text);
//--- excluímos todos os espaços à esquerda e enviamos o número de símbolos excluídos e a string resultante para o log 
   int num=StringTrimLeft(text);
   PrintFormat("The StringTrimLeft() function removed %d chars from the left side. Now the line looks like this:\n'%s'"numtext);
   
  /*
  Resultado
   Source line:
   '      All spaces on the left will be removed from this string'
   The StringTrimLeft() function removed 6 chars from the left sideNow the line looks like this:
   'All spaces on the left will be removed from this string'
  */
  }

Também Veja

StringTrimRight, StringToLower, StringToUpper