Chức năng VBScript CreateObject
❮ Toàn bộ tài liệu tham khảo VBScriptHàm CreateObject tạo một đối tượng của một kiểu cụ thể.
Cú pháp
CreateObject(servername.typename[,location])
Parameter | Description |
---|---|
servername | Required. The name of the application that provides the object |
typename | Required. The type/class of the object |
location | Optional. Where to create the object |
Thí dụ
Thí dụ
Tạo một đối tượng biểu thức chính quy:
<%
txt="This is a beautiful day"
Set objReg=CreateObject("vbscript.regexp")
objReg.Pattern="i"
response.write(objReg.Replace(txt,"##"))
%>
Đầu ra của đoạn mã trên sẽ là:
Th##s is a beautiful day
❮ Toàn bộ tài liệu tham khảo VBScript