# Posted By

choasis on 12/28/09

# Statistics

Viewed 351 times
Favorited by 1 user(s)

# General string-functions

/ Published in: ASP
`' Count the chars in a string' =========response.write(len("1234567"))' Output: 7' ========= ' Edit date' =========DateAdd(Interval, Amount, yourDate)DateAdd("ww", 2, now)DateAdd("ww", -2, now) ' Value	        Description' ============================' yyyy		Year' q	        Quarter' m	        Month' y	        Day of the year' d	        Day' w	        Weekday' ww	        Week of a year' h	        Hour' n	        Minute' s        	Second' ========= ' Search in string' =========foo = "12.34"response.write(instr(foo, "."))' Output: 3' ========= ' Cut string' =========response.write(left("1234567", 3))' Output: 123response.write(right("1234567", 3))' Output: 567response.write(mid("1234567", 3, 2))' Output: 34response.write(mid("1234567", 3))' Output: 567' ========= ' String into float' =========String = "12,26"Float = CDbl(String)Result = Float + 7.74' ========= ' String into int' =========String = "12,26"Int = CInt(String)Result = Int + 7.74' ========= ' Split string' =========foo = "My-Name"bar = split(foo, "-")response.write(bar(0) & " " & bar(1))' Output: My Name' ========= ' Replace' =========foo = "My-Name"response.write(replace(foo,"-"," "))' Output: My Name' =========`