Vbscript-strings
提供:Dev Guides
VBScript-文字列
文字列は文字のシーケンスであり、アルファベットや数字、特殊文字、またはそれらすべてで構成できます。 変数は、二重引用符 ""で囲まれている場合、文字列と呼ばれます。
構文
variablename = "string"
例
str1 = "string" ' Only Alphabets
str2 = "132.45" ' Only Numbers
str3 = "!@#$;*" ' Only Special Characters
Str4 = "Asc23@#" ' Has all the above
文字列関数
開発者が文字列を非常に効果的に操作するのに役立つ、事前定義されたVBScript文字列関数があります。 以下は、VBScriptでサポートされているStringメソッドです。 詳細を知るには、それぞれの方法をクリックしてください。
Function Name | Description |
---|---|
InStr | Returns the first occurrence of the specified substring. Search happens from left to right. |
InstrRev | Returns the first occurrence of the specified substring. Search happens from Right to Left. |
Lcase | Returns the lower case of the specified string. |
Ucase | Returns the Upper case of the specified string. |
Left | Returns a specific number of characters from the left side of the string. |
Right | Returns a specific number of characters from the Right side of the string. |
Mid | Returns a specific number of characters from a string based on the specified parameters. |
Ltrim | Returns a string after removing the spaces on the left side of the specified string. |
Rtrim | Returns a string after removing the spaces on the right side of the specified string. |
Trim | Returns a string value after removing both leading and trailing blank spaces. |
Len | Returns the length of the given string. |
Replace | Returns a string after replacing a string with another string. |
Space | Fills a string with the specified number of spaces. |
StrComp | Returns an integer value after comparing the two specified strings. |
String | Returns a String with a specified character the specified number of times. |
StrReverse | Returns a String after reversing the sequece of the characters of the given string. |