Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Semrush - keyword research tool

Create your online store today with Shopify

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Disclosure: My content contains affiliate links.

43,693 questions

57,001 answers

573 users

How to find missing alphabet characters from a string in Pascal

1 Answer

0 votes
program MissingAlphabet;

type
  TStringArray = array[1..26] of char;

procedure GetMissingAlphabetChars(Input: string; var Missing: TStringArray; var Count: Integer);
var
  Present: set of char;
  C: char;
  I: Integer;
begin
  Present := [];

  { Normalize input: lowercase + keep only a..z }
  for I := 1 to Length(Input) do
  begin
    C := Input[I];
    if (C >= 'A') and (C <= 'Z') then
      C := Chr(Ord(C) + 32);  { convert to lowercase }

    if (C >= 'a') and (C <= 'z') then
      Include(Present, C);
  end;

  { Collect missing letters }
  Count := 0;
  for C := 'a' to 'z' do
    if not (C in Present) then
    begin
      Inc(Count);
      Missing[Count] := C;
    end;
end;

var
  Missing: TStringArray;
  Count, I: Integer;

begin
  GetMissingAlphabetChars('PHP Programming', Missing, Count);

  for I := 1 to Count do
    WriteLn(Missing[I]);
end.





(*
run:

b
c
d
e
f
j
k
l
q
s
t
u
v
w
x
y
z

*)

 



answered Mar 6 by avibootz
...