strings.extract_domain

Compatible avec :
strings.extract_domain(url_string)

Description

Extrait le domaine d'une chaîne.

Types de données des paramètres

STRING

Type renvoyé

STRING

Exemples de code

Exemple 1

Cet exemple montre une chaîne vide

strings.extract_domain("") = ""
Exemple 2

Chaîne aléatoire, pas une URL

strings.extract_domain("1234") = ""
Exemple 3

plusieurs barres obliques inverses

strings.extract_domain("\\\\") = ""
Exemple 4

Gestion optimale des caractères non alphabétiques

strings.extract_domain("http://例子.卷筒纸.中国") = "卷筒纸.中国"
Exemple 5

Gestion des URI

strings.extract_domain("mailto:?to=&subject=&body=") = ""
Exemple 6

plusieurs caractères avant l'URL réelle.

strings.extract_domain("     \t   !$5*^)&dahgsdfs;http://www.google.com") = "google.com"
Exemple 7

Caractères spéciaux dans l'URI #

strings.extract_domain("test#@google.com") = ""
Exemple 8

Caractères spéciaux dans l'URL #

strings.extract_domain("https://test#@google.com") = ""
Exemple 9

scénario de test positif

strings.extract_domain("https://google.co.in") = "google.co.in"