Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetMainConjunction(const Expression: string): string;
- var
- P: PChar;
- BraceCnt: Integer;
- begin
- Result := '';
- BraceCnt := 0;
- P := PChar(Expression);
- while P^ <> #0 do
- begin
- case P^ of
- '(': Inc(BraceCnt);
- ')': Dec(BraceCnt);
- end;
- Inc(P);
- if BraceCnt = 0 then
- begin
- while (P^ = ' ') do
- Inc(P);
- SetString(Result, P, 2);
- Exit;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement