WordPress at a glance
function is not described

wc_format_country_state_string() WC 2.3.0

Formats a string in the format COUNTRY:STATE into an array.

No Hooks.

Return

Array. Nothing.

Usage

wc_format_country_state_string( $country_string );
$country_string(string) (required)
Country string.

Changelog

Since 2.3.0 Introduced.

Code of wc_format_country_state_string() WC 5.2.2

<?php
function wc_format_country_state_string( $country_string ) {
	if ( strstr( $country_string, ':' ) ) {
		list( $country, $state ) = explode( ':', $country_string );
	} else {
		$country = $country_string;
		$state   = '';
	}
	return array(
		'country' => $country,
		'state'   => $state,
	);
}