System.SysUtils.TStringHelper.CountChar

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function CountChar(const C: Char): Integer;

プロパティ

種類 可視性 ソース ユニット
function public System.SysUtils.pas System.SysUtils TStringHelper

説明

CountChar は、文字列の中に文字 C が出てくる回数をカウントします。

以下のコードは、文字列内の文字 "s" をカウントします。

 const
   myString = 'This string contains 5 occurrences of s';
 begin
   writeln(myString.CountChar('s'));
   readln;
 end.

関連項目