반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- 리베리카
- 제주도
- 커피역사
- xamarin
- 프렌치프레스
- xamarin.forms
- Classic ASP
- 여행
- 아라비카
- 커피
- KnockoutJS
- KO
- NGUI
- 원두
- Android
- shared
- 템플릿
- 커피풍미
- 로부스타
- 커피블로그
- ServerVariables
- Unity
- 함수
- fso
- 자마린
- vbscript
- asp
- xamarin.android
- 태그를 입력해 주세요.
- 드립 커피
Archives
- Today
- Total
개발人
문자열 바이트로 자르기 본문
<script language="vbscript" runat="server">
Function nLeft( str, strcut )
Dim bytesize
Dim nLeft_count
bytesize = 0
for nLeft_count = 1 to len( str )
if asc(mid( str, nLeft_count, 1 ) > 0 then '한글값은 0보다 작다
bytesize = bytesize + 1 '한글이 아닌경우 1Byte
else
bytesize = bytesize + 2 '한글이 경우 2Byte
end if
if strcut >= bytesize then nLeft = nLeft & mid( str, nLeft_count, 1 )
'자르고 싶은 길이 Byte만큼
next
if len( str ) > len( nLeft ) then nLeft = left( nLeft, len(nLeft) - 2 ) & "..."
'문자열이 짤렸을 경우 뒤에 ...을 붙여줌
End Function
</script>
반응형
'Classic ASP' 카테고리의 다른 글
| 유용한 함수들 (0) | 2015.05.23 |
|---|---|
| Response Object (0) | 2014.08.31 |
| global.asa (0) | 2014.08.11 |
| cmd 객체 (0) | 2014.08.11 |
| 키를 구하는 소스 (0) | 2014.08.11 |
Comments