Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/URL-encoding/Liberty-BASIC/url-encoding.basic
Normal file
23
Task/URL-encoding/Liberty-BASIC/url-encoding.basic
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
dim lookUp$( 256)
|
||||
|
||||
for i =0 to 256
|
||||
lookUp$( i) ="%" +dechex$( i)
|
||||
next i
|
||||
|
||||
string$ ="http://foo bar/"
|
||||
|
||||
print "Supplied string '"; string$; "'"
|
||||
print "As URL '"; url$( string$); "'"
|
||||
|
||||
end
|
||||
|
||||
function url$( i$)
|
||||
for j =1 to len( i$)
|
||||
c$ =mid$( i$, j, 1)
|
||||
if instr( "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", c$) then
|
||||
url$ =url$ +c$
|
||||
else
|
||||
url$ =url$ +lookUp$( asc( c$))
|
||||
end if
|
||||
next j
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue