ASP Substring
프로그래밍/웹 쪽2007. 6. 15. 13:25
ASP Substring 찾다가 찾아낸 함수.
참조할 변수와 시작 점 그리고 길이를 입력 하면 된다.
참고 사이트는 http://www.w3schools.com/vbscriptASP가 비베를 사용하니깐 비베 사이트에 ~_~
The Mid function returns a specified number of characters from a string.
Tip: Use the Len function to determine the number of characters in a string.
Syntax
Mid(string,start[,length]) |
Parameter | Description |
---|---|
string | Required. The string expression from which characters are returned |
start | Required. Specifies the starting position. If set to greater than the number of characters in string, it returns an empty string ("") |
length | Optional. The number of characters to return |
Example 1
dim txt txt="This is a beautiful day!" document.write(Mid(txt,1,1)) Output: T |
Example 2
dim txt txt="This is a beautiful day!" document.write(Mid(txt,1,11)) Output: This is a b |
Example 3
dim txt txt="This is a beautiful day!" document.write(Mid(txt,1)) Output: This is a beautiful day! |
Example 4
dim txt txt="This is a beautiful day!" document.write(Mid(txt,10)) Output: beautiful day! |