Take the 2-minute tour ×

Is there a similar function as CharInSet in Delphi Prism? If not, how would you do it?

I looked online and on StackOverflow, but they speak in terms of Delphi not Delphi Prism for .NET.

I also found out that the include method for setting an element to a set is not available either.

what are the replacements, if any, for these method?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Use the in operator to test membership. Use the + operator in place of Include. A method like Include could not exist in Prism since sets are immutable in Prism.

See here for full details.

share|improve this answer
@ David - Oh good. I have been doing exactly what you said in your answer. I was just wondering if there were any other options. Thanks. –  Thayananthan Narayanan Sep 8 '11 at 19:02
Heh, in Delphi, CharInSet() is actually the replacement for in, since Delphi sets can only contain ordinal values up to and including 255. –  Rudy Velthuis Sep 9 '11 at 11:36
@Rudy Indeed so. Looks like Prism gets it right. –  David Heffernan Sep 9 '11 at 11:41
Prism is on .NET, and there, "characters" were always Unicode. I have no idea how in Prism, Pascal-like sets are realized, but I bet not the same way as in Pascal. –  Rudy Velthuis Sep 9 '11 at 12:23
add comment

Your Answer


