String
Osnovno
Length
Funkcija Length vrne dolžino stringa.
| Function Length (S As String) As Long | ||
| S | String | Besedilo, katerega dolžina nas zanima. |
| Result | Long | Dolžina stringa. |
Write (Length ('1234')) // izpiše 4Copy
Funkcija Copy vrne del stringa.
| Function Copy (S As String, Index, Count As Long) As String | ||
| S | String | Celo besedilo. |
| Index | Long | Začetek dela besedila. Prva črka ima ima vrednost 1. |
| Count | Long | Dolžina dela besedila. Če je 0, vrne besedilo do konca. |
| Result | String | Del besedila. |
Write (Copy ('1234', 2, 2)) // izpiše 23
Write (Copy ('1234', 2, 0)) // izpiše 234Delete
Rutina Delete briše del besedila.
| Sub Delete (ByRef S As String, Index, Count As Long) | ||
| S | ByRef String | Besedilo, ki ga spreminjamo. |
| Index | Long | Začetek brisanja besedila. Prva črka ima ima vrednost 1. |
| Count | Long | Dolžina brisanja besedila. |
Dim S As String
S = '1234'
Delete (S, 2, 2) // Briše del stringa
Write (S) // izpiše 14Insert
Rutina Insert Vrine en string v drugega.
| Sub Insert (Source As String, ByRef S As String, Index As Long) | ||
| Source | String | Besedilo, ki ga vrivamo. |
| S | ByRef String | Besedilo, kamor ga vrivamo. |
| Index | Long | Lokacija začetka vrinjenega besedila. Prva črka ima ima vrednost 1. |
Dim S As String
S = '1234'
Insert ('56', S, 2) // Briše del stringa
Write (S) // izpiše 156234Pos
Funkcija Pos vrne lokacijo stringa v stringu.
| Function Pos (SubStr, S As String) As Long | ||
| SubStr | String | Besedilo, ki ga iščemo. |
| S | String | Besedilo, v katerem iščemo |
| Result | Long | Lokacija prve pojavitve besedila. Prva črka ima ima vrednost 1. Če ne najde, vrne vrednost 0. |
Write (pos ('23', '1234')) // izpiše 2Replace
Funkcija Replace zamenja vse pojavitve določenega stringa v drug string.
| Function Replace (S, ChangeWhat, ChangeTo As String) As String | ||
| S | String | Osnovno besedilo. |
| ChangeWhat | String | Besedilo ki se zamenja. |
| ChangeTo | String | Besedilo v katerega se zamenja. |
| Result | String | Popravljen string. |
Write (Replace ('12341234', '23', '32')) // izpiše 13241324
Write (Replace ('1,2,3,4', ',', Line)) // primer menjave vejice z novo vrstoCompareStr
Funkcija CompareStr Primerja dva stringa med seboj.
| Function CompareStr (S1, S2 As String) As Long | ||
| S1 | String | Prvo besedilo. |
| S2 | String | Drugo besedilo. |
| Result | Long | če sta enaka vrne 0, če je prvi manjši od drugega vrne -1, če pa je prvi večji od drugega vrne 1. |
Write (CompareStr ('a', 'b')) // izpiše -1Velike male črke
LowerCase
Funkcija LowerCase vrne string pretvorjen v male črke.
| Function LowerCase (S As String) As String | ||
| S | String | Osnovno besedilo. |
| Result | String | Besedilo z malimi črkami. |
Write (LowerCase('Abc')) // izpiše abcUpperCase
Funkcija UpperCase vrne string pretvorjen v velike črke.
| Function UpperCase (S As String) As String | ||
| S | String | Osnovno besedilo. |
| Result | String | Besedilo z malimi črkami. |
Write (UpperCase('Abc')) // izpiše ABCPadding, trimming
PadLeft
Funkcija PadLeft vrine presledke na začetek stringa in s tem podaljša string do določene dolžine.
| Function PadLeft (S As String, Length As Long) As String | ||
| S | String | Osnovno besedilo. |
| Length | Long | Želena dolžina besedila. |
| Result | String | Podaljšano besedilo. |
Write (PadLeft('Abc', 5)) // izpiše " Abc"PadLeftCh
Funkcija PadLeftCh vrine določene znake na začetek stringa in s tem podaljša string do določene dolžine.
| Function PadLeftCh (S, Chars As String, Length As Long) As String | ||
| S | String | Osnovno besedilo. |
| Chars | String | Znak, ki se dodaja. |
| Length | Long | Želena dolžina besedila. |
| Result | String | Podaljšano besedilo. |
Write (PadLeftCh('Abc', '-', 5)) // izpiše "--Abc"PadRight
Funkcija PadRight doda presledke na konec stringa in s tem podaljša string do določene dolžine.
| Function PadRight (S As String, Length As Long) As String | ||
| S | String | Osnovno besedilo. |
| Length | Long | Želena dolžina besedila. |
| Result | String | Podaljšano besedilo. |
Write (PadRight('Abc', 5)) // izpiše "Abc "PadRightCh
Funkcija PadRightCh doda določene znake na konec stringa in s tem podaljša string do določene dolžine.
| Function PadRightCh (S, Chars As String, Length As Long) As String | ||
| S | String | Osnovno besedilo. |
| Chars | String | Znak, ki se dodaja. |
| Length | Long | Želena dolžina besedila. |
| Result | String | Podaljšano besedilo. |
Write (PadRightCh('Abc', '-', 5)) // izpiše "Abc--"Trim
Funkcija Trim odstrani presledke iz začetka in konca stringa.
| Function Trim (S As String) As String | ||
| S | String | Osnovno besedilo. |
| Result | String | Skrajšano besedilo. |
Write (Trim(' Abc ')) // izpiše "Abc"TrimLeft
Funkcija TrimLeft odstrani presledke iz začetka stringa.
| Function TrimLeft (S As String) As String | ||
| S | String | Osnovno besedilo. |
| Result | String | Skrajšano besedilo. |
Write (TrimLeft(' Abc ')) // izpiše "Abc "TrimRight
Funkcija TrimRight odstrani presledke iz konca stringa.
| Function TrimRight (S As String) As String | ||
| S | String | Osnovno besedilo. |
| Result | String | Skrajšano besedilo. |
Write (TrimRight(' Abc ')) // izpiše " Abc"Konstante
Spaces
Funkcija Spaces vrne string, ki vsebuje določeno število presledkov.
| Function Spaces (Length As Long) As String | ||
| Length | Long | Število presledkov. |
| Result | String | Besedilo presledkov. |
Write ('1' + Spaces(2) + '2') // izpiše "1 2"Chars
Funkcija Chars vrne string, ki vsebuje določeno število poljubnih znakov.
| Function Chars (Char As String, Length As Long) As String | ||
| Char | String | Znak, s katerim napolni besedilo. |
| Length | Long | Število znakov. |
| Result | String | Besedilo poljubnih znakov. |
Write ('1' + Chars('x', 2) + '2') // izpiše "1xx2"Line
Funkcija Line vrne string, ki pomeni novo vrstico (#13#10).
| Function Line As String | ||
| Result | String | Besedilo, ki predstavlja novo vrstico. |
Write ('ABC' + Line + 'DEF')) // izpiše text v 2 vrsticah
Write (Replace ('1,2,3,4', ',', Line)) // primer menjave vejice z novo vrstoTab
Funkcija Tab vrne string, ki pomeni tab črko (#09). Te se namreč ne da enostavno napisati, ker sistem uporablja tipko tab.
| Function Tab As String | ||
| Result | String | Besedilo, ki vsebuje tabulator. |
Write ('ABC' + Tab + 'DEF')) // izpiše text ločen z tab znakomRazno
CountLines
Funkcija CountLines .
| Function CountLines (S As String) As Long | ||
| S | String | . |
| Result | Long | . |
SortLines
Funkcija SortLines .
| Function SortLines (S As String) As String | ||
| S | String | . |
| Result | String | . |
WrapText
Funkcija WrapText .
| Function WrapText (S As String, Length As Long) As String | ||
| S | String | . |
| Length | Long | . |
| Result | String | . |
AddLinePrefixSuffix
Funkcija AddLinePrefixSuffix .
| Function AddLinePrefixSuffix (S, Prefix, Suffix As String) As String | ||
| S | String | . |
| Prefix | String | . |
| Suffix | String | . |
| Result | String | . |
LinesToTree
Funkcija LinesToTree .
| Function LinesToTree (S, Separator, Filler As String) As String | ||
| S | String | . |
| Separator | String | . |
| Filler | String | . |
| Result | String | . |
IfThenElseString
Funkcija IfThenElseString .
| Function IfThenElseString (Condition As Boolean, ThenValue, ElseValue As String) As String | ||
| Condition | Boolean | . |
| ThenValue | String | . |
| ElseValue | String | . |
| Result | String | . |
Sklon123
Funkcija Sklon123 .
| Function Sklon123 (I As Long, Ed, Dv, Mn As String) As String | ||
| I | Long | . |
| Ed | String | . |
| Dv | String | . |
| Mn | String | . |
| Result | String | . |
Sklon1235
Funkcija Sklon1235 .
| Function Sklon1235 (I As Long, Ed, Dv, Tr, Mn As String) As String | ||
| I | Long | . |
| Ed | String | . |
| Dv | String | . |
| Tr | String | . |
| Mn | String | . |
| Result | String | . |
Encode, Decode
EncodeUTF8
Funkcija EncodeUTF8 .
| Function EncodeUTF8 (S As String) As String | ||
| S | String | . |
| Result | String | . |
EncodeUTF8XML
Funkcija EncodeUTF8XML .
| Function EncodeUTF8XML (S As String) As String | ||
| S | String | . |
| Result | String | . |
DecodeBase64
Funkcija DecodeBase64 .
| Function DecodeBase64 (S As String) As String | ||
| S | String | . |
| Result | String | . |
EncodeBase64
Funkcija EncodeBase64 .
| Function EncodeBase64 (S As String) As String | ||
| S | String | . |
| Result | String | . |
DecodeBase64ToFile
Rutina DecodeBase64ToFile .
| Sub DecodeBase64ToFile (S, FileName As String) | ||
| S | String | . |
| FileName | String | . |