Documentation
Back to website >

SplitCountry (Pascalscript)

Description

The SplitCountry function extracts the country, zip code and city from a complete location specification.

Syntax

function SplitCountry(const S: string; DefaulCountry: string): string;

Arguments

The function filters the country from a long city name, consisting of country, zip code and city name. If no country is recognized in string S, the country is transferred from DefaultCountry.

Excample

var
  S1: String;
  S2: String;
begin
  S1:='65527 Niedernhausen';
  S2:=SplitCountry(S1,'D');
  ShowMessage(S2);
end;

Rules to understand the script can be found here.

The text '65527 Niedernhausen' is assigned to the string variable S1. The SplitCity function contains the second parameter 'D', the default country, in case no country is recognized in S1. SplitFilter always returns a country and assigns the result to the variable S2.

ShowMessage shows: D