Arnold
Arnold

Reputation: 4840

How to use TCharHelper?

The next code:

function get_symbol (var s: String): String;
var c: Char;
    p: Int32;
begin
// ... some more code ...
   c := upcase (s [p]);
   if IsDigit (c) then

causes the following error message:

[dcc32 Warning] fmx_utilities_string.pas(188): W1000 Symbol 'IsDigit' is deprecated: 'Use TCharHelper'

I don't understand this message as System.Character is included, c is declared to be Char and TCharhelper is declared as a character helper of Char. What am I doing wrong?

Upvotes: 9

Views: 6556

Answers (1)

Ken White
Ken White

Reputation: 125620

You're not using TCharHelper; you're using the old System.Character IsDigit function instead. The way to use TCharHelper.IsDigit is:

if c.IsDigit then
  ...

Upvotes: 12

Related Questions