반응형
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 | 31 |
Tags
- 함수
- xamarin.android
- 제주도
- ServerVariables
- robusta
- 아라비카
- KO
- liberica
- Android
- 자마린
- xamarin.forms
- 템플릿
- 프렌치프레스
- 태그를 입력해 주세요.
- 원두
- vbscript
- KnockoutJS
- asp
- 수마트라 원두
- shared
- xamarin
- 드립 커피
- NGUI
- 라이트 로스팅
- 커피
- 여행
- Classic ASP
- fso
- 미디엄 로스팅
- Unity
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