Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:22:32+00:00 2026-06-13T06:22:32+00:00

As coming from python I’m looking for something equivalent to this python code (

  • 0

As coming from python I’m looking for something equivalent to this python code (sets) in delphi5:

>>> x = set("Hello")
>>> x
set(['H', 'e', 'l', 'o'])

>>> y = set("Hallo")
>>> y
set(['a', 'H', 'l', 'o'])

>>> x.intersection(y)
set(['H', 'l', 'o'])
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:22:33+00:00Added an answer on June 13, 2026 at 6:22 am
    var
      a, b, c: set of byte;
    begin
      a := [1, 2, 3, 4];
      b := [3, 4, 5, 6];
      c := a*b;          // c is the intersection of a and b, i.e., c = [3, 4]
    

    But beware:

    var
      a, b, c: set of integer;
    

    will not even compile; instead, you get the ‘Sets may have at most 256 elements’ error. Please see the documentation for more information on Delphi sets.

    Update

    Sorry, forgot to mention the ‘obvious’ (from the point of view of a Delphi programmer):

    var
      a, b, c: set of char;
    begin
      a := ['A', 'B', 'C', 'D'];
      b := ['C', 'D', 'E', 'F'];
      c := a*b;          // c is the intersection of a and b, i.e., c = ['C', 'D']
    

    But your chars will all be byte chars — that is, forget about Unicode (Delphi 5 doesn’t support Unicode, so in this case this isn’t really a restriction)!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coming from javascript/php/python and probably I'm missing something, here is the code: const
Coming to Java from Python. I recognize this is pretty basic, but it doesn't
I'm learning python and Django coming from PHP. This is all really exciting, and
I have the following python code that expects data coming from the serial port,
Coming from a Java background, I understand that __str__ is something like a Python
I'm starting with Python coming from java. I was wondering if there exists something
Coming from MATLAB, I am looking for some way to create functions in Python
I'm somewhat new to C++, coming from python. One piece of functionality I really
I'm new to C# coming from a python background. I've had a hard time
I´m trying to learn C#, coming from a Python/PHP background, and I´m trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.