StringTrimLeft

Dizginin sol tarafındaki ilk anlamlı sembolden önce gelen satır atlama karakterlerini, boşlukları ve sekmeleri keser. Dizgi, yerinde şekillendirilir.

int  StringTrimLeft(
   string&  string_var      // kırpılacak dizgi
   );

Parametreler

string_var

[in][out]  Soldan kırpılacak dizgi.

Dönüş değeri

Kırpılan sembollerin sayısına dönüş yapar.

Example:

void OnStart()
  {
//--- define the source string with six spaces on the left
   string text="      All spaces on the left will be removed from this string";
//--- Display the source string in the log
   PrintFormat("Source line:\n'%s'"text);
//--- remove all spaces on the left and display the number of removed characters and the resulting string in the 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);
   
   /*
   Result
   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'
   */
  }

Ayrıca Bakınız

StringTrimRight, StringToLower, StringToUpper