ฟังก์ชันVBScript CStr
❮ การอ้างอิง VBScript ที่สมบูรณ์
ฟังก์ชัน CStr แปลงนิพจน์เป็นประเภทสตริง
ไวยากรณ์
Parameter |
Description |
expression |
Required. Any valid expression If expression is:
- Boolean - then the CStr function will return a string containing true
or false.
- Date - then the CStr function will return a string that contains a
date in the short-date format.
- Null - then a run-time error will occur.
- Empty - then the CStr function will return an empty string ("").
- Error - then the CStr function will return a string that contains the
word "Error" followed by an error number.
- Other numeric - then the CStr function will return a string that
contains the number.
|
ตัวอย่าง
ตัวอย่าง
<%
response.write(CStr("300000") & "<br />")
response.write(CStr(#10-05-25#) & "<br />")
%>
ผลลัพธ์ของโค้ดด้านบนจะเป็น:
300000
10/5/2025
❮ การอ้างอิง VBScript ที่สมบูรณ์