String函式

語法,部分 說明,說明,
String函式 返回
返回 Variant (String),其中包含指定長度重複字元的字元串。

語法

String(number, character)
String 函式的語法有下面的命名參數:

部分 說明

number 必要參數;Long。返回的字元串長度。如果 number 包含 Null,將返回 Null。
character 必要參數;Variant。為指定字元的字元碼或字元串表達式,其第一個字元將用於建立返回的字元串。如果 character 包含 Null,就會返回 Null。
注意number是返回的字元串長度,而不是character的重複次數。
實例:
z=string(3,"w")
z的返回值是:www
z=string(3,"aw")
z的返回值是:awa
z=string(3,"www")
z的返回值是:www

說明

如果指定 character 的數值大於 255,String 會按下面的公式將其轉為有效的字元碼:
character Mod 256

相關詞條

熱門詞條

聯絡我們