Home  |  Delphi .net Home  |  System.Globalization.StringInfo  |  GetNextTextElement Method
  
GetNextTextElement  
Method  
Returns a Text element from the given String
StringInfo Class
System.Globalization NameSpace
CF1.  Function GetNextTextElement ( TextString : String ) : String; Static;
CF2.  Function GetNextTextElement ( TextString : String; Index : Integer ) : String; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
The GetNextTextElement method returns a Text element from the given TextString.
 
The element returned is always the first (0 index) unless the Index value is provided.
Notes
Very Important : Methods in .Net treat strings as starting at 0, unlike traditional Delphi where they started at 1.
Microsoft MSDN Links
System.Globalization
System.Globalization.StringInfo
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

uses
  System.Globalization;

var
  myString   : String;
  myText     : String;
  i          : Integer;

begin
  myString := 'Hello';

  // Get the text elements of this string
  try
    for i := 0 to Length(myString)-1 do
    begin
      myText := StringInfo.GetNextTextElement(myString, i);
      Console.WriteLine(myText);
    end;

  except
    On E : Exception do
      Console.WriteLine(E.Message);
  end;

  Console.ReadLine;
end.
   H
   e
   l
   l
   o
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author