Fonction de jointure VBScript

Une fonction, qui renvoie une chaîne contenant un nombre spécifié de sous-chaînes dans un tableau. C'est une fonction exactement opposée à la méthode de fractionnement.

Syntaxe

Join(List[,delimiter])
  • List, un paramètre obligatoire. Un tableau contenant les sous-chaînes à joindre.

  • delimiter, un paramètre facultatif. Le caractère, utilisé comme délimiteur lors du renvoi de la chaîne. Le délimiteur par défaut est Espace.

Exemple

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         ' Join using spaces
         a = array("Red","Blue","Yellow")
         b = join(a)
         document.write("The value of b " & " is :"  & b & "<br />")

         ' Join using $
         b = join(a,"$")
         document.write("The Join result after using delimiter is : " & b & "<br />")

      </script>
   </body>
</html>

Lorsque le code ci-dessus est enregistré au format .html et exécuté dans Internet Explorer, il produit le résultat suivant -

The value of b is :Red Blue Yellow
The Join result after using delimiter is : Red$Blue$Yellow