vb6parse 1.0.1

vb6parse is a library for parsing and analyzing VB6 code, from projects, to controls, to modules, and forms.
Documentation
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="VB6Parse Library Reference - strreverse - String">
    <title>strreverse - String - VB6Parse Library Reference</title>
    <link rel="stylesheet" href="../../../assets/css/style.css">
    <link rel="stylesheet" href="../../../assets/css/docs-style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
    <script src="../../../assets/js/theme-switcher.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/vbnet.min.js"></script>
    <script>hljs.highlightAll();</script>
</head>
<body>
    <header class="docs-header">
        <div class="container">
            <h1><a href="../../../index.html">VB6Parse</a> / <a href="../../../library/index.html">Library</a> / <a href="../../../library/functions/string/index.html">String</a> / strreverse</h1>
            <p class="tagline">VB6 Library Reference</p>
        </div>
    </header>

    <nav class="docs-nav">
        <div class="container">
            <a href="../../../index.html">Home</a>
            <a href="../../../library/index.html">Library Reference</a>
            <a href="../../../documentation.html">Documentation</a>
            <a href="https://docs.rs/vb6parse" target="_blank">API Docs</a>
            <a href="https://github.com/scriptandcompile/vb6parse" target="_blank">GitHub</a>
            <button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
                <span class="theme-icon">🌙</span>
            </button>
        </div>
    </nav>

    <main class="container">
        
        <article class="library-item">
            <p>VB6 StrReverse Function
The <code>StrReverse</code> function returns a string in which the character order of a specified string is reversed.</p>
<h2 id="syntax">Syntax</h2>
<pre><code class="language-vbnet">StrReverse(expression)</code></pre>
<h2 id="parameters">Parameters</h2>
<ul>
<li><code>expression</code>: Required. String expression whose characters are to be reversed. If <code>expression</code> is a zero-length string (""), a zero-length string is returned.</li>
</ul>
<h2 id="returns">Returns</h2>
<p>Returns a <code>String</code> with the characters in reverse order.</p>
<h2 id="remarks">Remarks</h2>
<p>The <code>StrReverse</code> function reverses the order of characters in a string:
- <strong>Character-by-character reversal</strong>: Reverses individual characters, not words
- <strong>Unicode support</strong>: Works correctly with Unicode characters
- <strong>Empty string handling</strong>: Returns empty string if input is empty
- <strong>Null handling</strong>: Returns <code>Null</code> if <code>expression</code> is <code>Null</code>
- <strong>Preserves spaces</strong>: Spaces are treated like any other character and reversed
- <strong>Case preserved</strong>: Original case of characters is maintained
- <strong>Single pass</strong>: Efficient single-pass algorithm
- <strong>VB6/VBA only</strong>: Available in VB6 and VBA, not in <code>VBScript</code></p>
<h3 id="common-use-cases">Common Use Cases</h3>
<ul>
<li>Reversing strings for display or analysis</li>
<li>Palindrome checking (compare string with its reverse)</li>
<li>Text transformations and puzzles</li>
<li>Data obfuscation (simple, not secure)</li>
<li>Mirror text effects</li>
<li>String manipulation algorithms</li>
</ul>
<h3 id="comparison-with-manual-reversal">Comparison with Manual Reversal</h3>
<p><code>StrReverse</code> is more efficient than manually reversing with loops:</p>
<pre><code class="language-vbnet">&#x27; Using StrReverse (preferred)
reversed = StrReverse(original)
&#x27; Manual reversal (slower)
For i = Len(original) To 1 Step -1
    reversed = reversed &amp; Mid$(original, i, 1)
Next i</code></pre>
<h2 id="typical-uses">Typical Uses</h2>
<ol>
<li><strong>Palindrome Detection</strong>: Check if a string reads the same forwards and backwards</li>
<li><strong>Text Effects</strong>: Create mirror or reversed text displays</li>
<li><strong>String Analysis</strong>: Analyze patterns in reversed strings</li>
<li><strong>Data Transformation</strong>: Transform data for specific algorithms</li>
<li><strong>Puzzles and Games</strong>: Implement word games and puzzles</li>
<li><strong>File Processing</strong>: Process files that store data in reverse order</li>
<li><strong>Encoding</strong>: Simple (non-cryptographic) string obfuscation</li>
<li><strong>Testing</strong>: Generate test data with predictable patterns</li>
</ol>
<h2 id="basic-examples">Basic Examples</h2>
<h3 id="example-1-basic-string-reversal">Example 1: Basic String Reversal</h3>
<pre><code class="language-vbnet">Dim original As String
Dim reversed As String
original = &quot;Hello&quot;
reversed = StrReverse(original)  &#x27; &quot;olleH&quot;
original = &quot;VB6&quot;
reversed = StrReverse(original)  &#x27; &quot;6BV&quot;
original = &quot;12345&quot;
reversed = StrReverse(original)  &#x27; &quot;54321&quot;</code></pre>
<h3 id="example-2-palindrome-check">Example 2: Palindrome Check</h3>
<pre><code class="language-vbnet">Function IsPalindrome(text As String) As Boolean
    Dim normalized As String
    &#x27; Remove spaces and convert to lowercase for comparison
    normalized = Replace(LCase$(text), &quot; &quot;, &quot;&quot;)
    &#x27; Compare with reversed version
    IsPalindrome = (normalized = StrReverse(normalized))
End Function
&#x27; Examples:
&#x27; IsPalindrome(&quot;racecar&quot;) = True
&#x27; IsPalindrome(&quot;A man a plan a canal Panama&quot;) = True (after normalization)
&#x27; IsPalindrome(&quot;hello&quot;) = False</code></pre>
<h3 id="example-3-reverse-words-in-sentence">Example 3: Reverse Words in Sentence</h3>
<pre><code class="language-vbnet">Function ReverseWords(sentence As String) As String
    Dim words() As String
    Dim i As Integer
    Dim result As String
    words = Split(sentence, &quot; &quot;)
    result = &quot;&quot;
    For i = UBound(words) To LBound(words) Step -1
        If i &lt; UBound(words) Then result = result &amp; &quot; &quot;
        result = result &amp; words(i)
    Next i
    ReverseWords = result
End Function
&#x27; Example: &quot;Hello World&quot; becomes &quot;World Hello&quot;</code></pre>
<h3 id="example-4-simple-obfuscation">Example 4: Simple Obfuscation</h3>
<pre><code class="language-vbnet">Function ObfuscateString(text As String) As String
    &#x27; Simple, non-secure obfuscation
    ObfuscateString = StrReverse(text)
End Function
Function DeobfuscateString(text As String) As String
    &#x27; Reverse the obfuscation
    DeobfuscateString = StrReverse(text)
End Function</code></pre>
<h2 id="common-patterns">Common Patterns</h2>
<h3 id="pattern-1-check-palindrome-case-insensitive">Pattern 1: Check Palindrome (Case-Insensitive)</h3>
<pre><code class="language-vbnet">Function IsPalindromeIgnoreCase(text As String) As Boolean
    Dim lower As String
    lower = LCase$(text)
    IsPalindromeIgnoreCase = (lower = StrReverse(lower))
End Function</code></pre>
<h3 id="pattern-2-reverse-each-word">Pattern 2: Reverse Each Word</h3>
<pre><code class="language-vbnet">Function ReverseEachWord(sentence As String) As String
    Dim words() As String
    Dim i As Integer
    words = Split(sentence, &quot; &quot;)
    For i = LBound(words) To UBound(words)
        words(i) = StrReverse(words(i))
    Next i
    ReverseEachWord = Join(words, &quot; &quot;)
End Function</code></pre>
<h3 id="pattern-3-get-last-n-characters-efficiently">Pattern 3: Get Last N Characters Efficiently</h3>
<pre><code class="language-vbnet">Function GetLastNChars(text As String, n As Integer) As String
    Dim reversed As String
    reversed = StrReverse(text)
    GetLastNChars = StrReverse(Left$(reversed, n))
End Function</code></pre>
<h3 id="pattern-4-check-if-strings-are-reverses">Pattern 4: Check If Strings Are Reverses</h3>
<pre><code class="language-vbnet">Function AreReverses(str1 As String, str2 As String) As Boolean
    AreReverses = (str1 = StrReverse(str2))
End Function</code></pre>
<h3 id="pattern-5-reverse-file-extension">Pattern 5: Reverse File Extension</h3>
<pre><code class="language-vbnet">Function ReverseExtension(filename As String) As String
    Dim dotPos As Integer
    Dim name As String
    Dim ext As String
    dotPos = InStrRev(filename, &quot;.&quot;)
    If dotPos &gt; 0 Then
        name = Left$(filename, dotPos - 1)
        ext = Mid$(filename, dotPos + 1)
        ReverseExtension = name &amp; &quot;.&quot; &amp; StrReverse(ext)
    Else
        ReverseExtension = filename
    End If
End Function</code></pre>
<h3 id="pattern-6-mirror-text-display">Pattern 6: Mirror Text Display</h3>
<pre><code class="language-vbnet">Function CreateMirrorText(text As String) As String
    CreateMirrorText = text &amp; &quot; | &quot; &amp; StrReverse(text)
End Function</code></pre>
<h3 id="pattern-7-reverse-and-uppercase">Pattern 7: Reverse and Uppercase</h3>
<pre><code class="language-vbnet">Function ReverseAndUpper(text As String) As String
    ReverseAndUpper = UCase$(StrReverse(text))
End Function</code></pre>
<h3 id="pattern-8-find-reverse-match-in-array">Pattern 8: Find Reverse Match in Array</h3>
<pre><code class="language-vbnet">Function FindReverseMatch(arr() As String, searchValue As String) As Integer
    Dim i As Integer
    Dim reversed As String
    reversed = StrReverse(searchValue)
    For i = LBound(arr) To UBound(arr)
        If arr(i) = reversed Then
            FindReverseMatch = i
            Exit Function
        End If
    Next i
    FindReverseMatch = -1
End Function</code></pre>
<h3 id="pattern-9-reverse-between-delimiters">Pattern 9: Reverse Between Delimiters</h3>
<pre><code class="language-vbnet">Function ReverseBetween(text As String, startDelim As String, endDelim As String) As String
    Dim startPos As Integer
    Dim endPos As Integer
    Dim middle As String
    startPos = InStr(text, startDelim)
    endPos = InStr(startPos + Len(startDelim), text, endDelim)
    If startPos &gt; 0 And endPos &gt; startPos Then
        middle = Mid$(text, startPos + Len(startDelim), endPos - startPos - Len(startDelim))
        ReverseBetween = Left$(text, startPos + Len(startDelim) - 1) &amp; _
                        StrReverse(middle) &amp; _
                        Mid$(text, endPos)
    Else
        ReverseBetween = text
    End If
End Function</code></pre>
<h3 id="pattern-10-alternate-characters-reversed">Pattern 10: Alternate Characters Reversed</h3>
<pre><code class="language-vbnet">Function AlternateReverse(text As String) As String
    Dim i As Integer
    Dim result As String
    Dim reversed As String
    reversed = StrReverse(text)
    result = &quot;&quot;
    For i = 1 To Len(text)
        If i Mod 2 = 1 Then
            result = result &amp; Mid$(text, i, 1)
        Else
            result = result &amp; Mid$(reversed, i, 1)
        End If
    Next i
    AlternateReverse = result
End Function</code></pre>
<h2 id="advanced-usage">Advanced Usage</h2>
<h3 id="example-1-palindrome-checker-class">Example 1: Palindrome Checker Class</h3>
<pre><code class="language-vbnet">&#x27; Class: PalindromeChecker
&#x27; Checks various types of palindromes
Option Explicit
Private m_IgnoreCase As Boolean
Private m_IgnoreSpaces As Boolean
Private m_IgnorePunctuation As Boolean
Public Sub Initialize(Optional ignoreCase As Boolean = True, _
                      Optional ignoreSpaces As Boolean = True, _
                      Optional ignorePunctuation As Boolean = False)
    m_IgnoreCase = ignoreCase
    m_IgnoreSpaces = ignoreSpaces
    m_IgnorePunctuation = ignorePunctuation
End Sub
Public Function IsPalindrome(text As String) As Boolean
    Dim normalized As String
    normalized = NormalizeText(text)
    IsPalindrome = (normalized = StrReverse(normalized))
End Function
Public Function GetLongestPalindromeSubstring(text As String) As String
    Dim i As Integer
    Dim j As Integer
    Dim substring As String
    Dim longest As String
    longest = &quot;&quot;
    For i = 1 To Len(text)
        For j = i To Len(text)
            substring = Mid$(text, i, j - i + 1)
            If IsPalindrome(substring) And Len(substring) &gt; Len(longest) Then
                longest = substring
            End If
        Next j
    Next i
    GetLongestPalindromeSubstring = longest
End Function
Private Function NormalizeText(text As String) As String
    Dim result As String
    result = text
    If m_IgnoreCase Then
        result = LCase$(result)
    End If
    If m_IgnoreSpaces Then
        result = Replace(result, &quot; &quot;, &quot;&quot;)
    End If
    If m_IgnorePunctuation Then
        result = RemovePunctuation(result)
    End If
    NormalizeText = result
End Function
Private Function RemovePunctuation(text As String) As String
    Dim i As Integer
    Dim char As String
    Dim result As String
    result = &quot;&quot;
    For i = 1 To Len(text)
        char = Mid$(text, i, 1)
        If (char &gt;= &quot;A&quot; And char &lt;= &quot;Z&quot;) Or (char &gt;= &quot;a&quot; And char &lt;= &quot;z&quot;) Or _
           (char &gt;= &quot;0&quot; And char &lt;= &quot;9&quot;) Then
            result = result &amp; char
        End If
    Next i
    RemovePunctuation = result
End Function</code></pre>
<h3 id="example-2-string-reversal-utilities">Example 2: String Reversal Utilities</h3>
<pre><code class="language-vbnet">&#x27; Module: StringReversalUtils
&#x27; Utilities for reversing strings in various ways
Option Explicit
Public Function ReverseString(text As String) As String
    ReverseString = StrReverse(text)
End Function
Public Function ReverseWords(sentence As String) As String
    Dim words() As String
    Dim i As Integer
    Dim result As String
    words = Split(sentence, &quot; &quot;)
    result = &quot;&quot;
    For i = UBound(words) To LBound(words) Step -1
        If Len(result) &gt; 0 Then result = result &amp; &quot; &quot;
        result = result &amp; words(i)
    Next i
    ReverseWords = result
End Function
Public Function ReverseEachWord(sentence As String) As String
    Dim words() As String
    Dim i As Integer
    words = Split(sentence, &quot; &quot;)
    For i = LBound(words) To UBound(words)
        words(i) = StrReverse(words(i))
    Next i
    ReverseEachWord = Join(words, &quot; &quot;)
End Function
Public Function ReverseLines(text As String) As String
    Dim lines() As String
    Dim i As Integer
    Dim result As String
    lines = Split(text, vbCrLf)
    result = &quot;&quot;
    For i = UBound(lines) To LBound(lines) Step -1
        If Len(result) &gt; 0 Then result = result &amp; vbCrLf
        result = result &amp; lines(i)
    Next i
    ReverseLines = result
End Function
Public Function ReverseArray(arr() As String) As String()
    Dim result() As String
    Dim i As Integer
    Dim j As Integer
    ReDim result(LBound(arr) To UBound(arr))
    j = LBound(arr)
    For i = UBound(arr) To LBound(arr) Step -1
        result(j) = arr(i)
        j = j + 1
    Next i
    ReverseArray = result
End Function</code></pre>
<h3 id="example-3-text-transformer-class">Example 3: Text Transformer Class</h3>
<pre><code class="language-vbnet">&#x27; Class: TextTransformer
&#x27; Performs various text transformations including reversal
Option Explicit
Public Function Transform(text As String, transformType As String) As String
    Select Case UCase$(transformType)
        Case &quot;REVERSE&quot;
            Transform = StrReverse(text)
        Case &quot;REVERSE_WORDS&quot;
            Transform = ReverseWords(text)
        Case &quot;REVERSE_EACH_WORD&quot;
            Transform = ReverseEachWord(text)
        Case &quot;MIRROR&quot;
            Transform = text &amp; &quot; &quot; &amp; StrReverse(text)
        Case &quot;PALINDROME&quot;
            Transform = text &amp; StrReverse(text)
        Case Else
            Transform = text
    End Select
End Function
Private Function ReverseWords(sentence As String) As String
    Dim words() As String
    Dim i As Integer
    Dim result As String
    words = Split(sentence, &quot; &quot;)
    result = &quot;&quot;
    For i = UBound(words) To LBound(words) Step -1
        If Len(result) &gt; 0 Then result = result &amp; &quot; &quot;
        result = result &amp; words(i)
    Next i
    ReverseWords = result
End Function
Private Function ReverseEachWord(sentence As String) As String
    Dim words() As String
    Dim i As Integer
    words = Split(sentence, &quot; &quot;)
    For i = LBound(words) To UBound(words)
        words(i) = StrReverse(words(i))
    Next i
    ReverseEachWord = Join(words, &quot; &quot;)
End Function
Public Function CreatePalindrome(text As String) As String
    CreatePalindrome = text &amp; StrReverse(text)
End Function
Public Function IsPalindrome(text As String) As Boolean
    IsPalindrome = (text = StrReverse(text))
End Function</code></pre>
<h3 id="example-4-string-analyzer-module">Example 4: String Analyzer Module</h3>
<pre><code class="language-vbnet">&#x27; Module: StringAnalyzer
&#x27; Analyzes strings using reversal techniques
Option Explicit
Public Function ContainsPalindrome(text As String, minLength As Integer) As Boolean
    Dim i As Integer
    Dim j As Integer
    Dim substring As String
    For i = 1 To Len(text) - minLength + 1
        For j = minLength To Len(text) - i + 1
            substring = Mid$(text, i, j)
            If substring = StrReverse(substring) Then
                ContainsPalindrome = True
                Exit Function
            End If
        Next j
    Next i
    ContainsPalindrome = False
End Function
Public Function FindAllPalindromes(text As String, minLength As Integer) As Collection
    Dim palindromes As New Collection
    Dim i As Integer
    Dim j As Integer
    Dim substring As String
    For i = 1 To Len(text)
        For j = minLength To Len(text) - i + 1
            substring = Mid$(text, i, j)
            If substring = StrReverse(substring) Then
                On Error Resume Next
                palindromes.Add substring, substring
                On Error GoTo 0
            End If
        Next j
    Next i
    Set FindAllPalindromes = palindromes
End Function
Public Function GetSymmetryScore(text As String) As Double
    &#x27; Calculate how symmetric a string is (0-100%)
    Dim matches As Integer
    Dim i As Integer
    Dim len As Integer
    len = Len(text)
    If len = 0 Then
        GetSymmetryScore = 0
        Exit Function
    End If
    matches = 0
    For i = 1 To len \ 2
        If Mid$(text, i, 1) = Mid$(text, len - i + 1, 1) Then
            matches = matches + 1
        End If
    Next i
    GetSymmetryScore = (matches / (len \ 2)) * 100
End Function
Public Function IsAnagram(str1 As String, str2 As String) As Boolean
    &#x27; Not directly using StrReverse, but useful utility
    Dim sorted1 As String
    Dim sorted2 As String
    sorted1 = SortString(LCase$(str1))
    sorted2 = SortString(LCase$(str2))
    IsAnagram = (sorted1 = sorted2)
End Function
Private Function SortString(text As String) As String
    &#x27; Simple bubble sort for demonstration
    Dim chars() As String
    Dim i As Integer
    Dim j As Integer
    Dim temp As String
    ReDim chars(1 To Len(text))
    For i = 1 To Len(text)
        chars(i) = Mid$(text, i, 1)
    Next i
    For i = 1 To UBound(chars) - 1
        For j = i + 1 To UBound(chars)
            If chars(i) &gt; chars(j) Then
                temp = chars(i)
                chars(i) = chars(j)
                chars(j) = temp
            End If
        Next j
    Next i
    SortString = Join(chars, &quot;&quot;)
End Function</code></pre>
<h2 id="error-handling">Error Handling</h2>
<p>The <code>StrReverse</code> function typically does not raise errors under normal circumstances:
- Returns empty string if input is empty string
- Returns <code>Null</code> if input is <code>Null</code> (not an error)
- <strong>Error 13 (Type mismatch)</strong>: If <code>expression</code> cannot be converted to a string</p>
<h2 id="performance-notes">Performance Notes</h2>
<ul>
<li>Very fast and efficient (optimized native function)</li>
<li>Much faster than manual character-by-character reversal in VB6</li>
<li>Performance is O(n) where n is string length</li>
<li>No significant overhead for typical string lengths</li>
<li>For very large strings (megabytes), consider memory constraints</li>
</ul>
<h2 id="best-practices">Best Practices</h2>
<ol>
<li><strong>Use <code>StrReverse</code></strong> instead of manual loops for reversing strings (faster and cleaner)</li>
<li><strong>Handle Null values</strong> explicitly when working with Variant types</li>
<li><strong>Normalize before palindrome checks</strong> (remove spaces, convert case)</li>
<li><strong>Don't use for security</strong> - <code>StrReverse</code> is not encryption, only obfuscation</li>
<li><strong>Cache reversed strings</strong> if used multiple times in comparisons</li>
<li><strong>Combine with other functions</strong> like <code>LCase$</code>, <code>Trim$</code> for text processing</li>
<li><strong>Test edge cases</strong> like empty strings and single-character strings</li>
<li><strong>Document intent</strong> when using <code>StrReverse</code> in non-obvious ways</li>
<li><strong>Consider alternatives</strong> for word-level reversal (Split/Join approach)</li>
<li><strong>Use for validation</strong> like palindrome checking or symmetry analysis</li>
</ol>
<h2 id="comparison-table">Comparison Table</h2>
<table>
<thead>
<tr>
<th>Approach</th>
<th>Code</th>
<th>Speed</th>
<th>Clarity</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>StrReverse</code></td>
<td><code>StrReverse(s)</code></td>
<td>Fast</td>
<td>Excellent</td>
</tr>
<tr>
<td>Manual loop</td>
<td><code>For i = Len(s) To 1 Step -1...</code></td>
<td>Slow</td>
<td>Poor</td>
</tr>
<tr>
<td>Recursion</td>
<td><code>ReverseRecursive(s)</code></td>
<td>Very slow</td>
<td>Poor</td>
</tr>
</tbody>
</table>
<h2 id="platform-notes">Platform Notes</h2>
<ul>
<li>Available in VB6 and VBA</li>
<li><strong>Not available in <code>VBScript</code></strong> (must implement manually)</li>
<li>Works correctly with Unicode characters</li>
<li>Behavior consistent across VB6 and VBA</li>
<li>No locale-specific behavior</li>
</ul>
<h2 id="limitations">Limitations</h2>
<ul>
<li>Cannot reverse only part of a string (use <code>Mid$</code> to extract first)</li>
<li>Cannot reverse words rather than characters (use Split/Join)</li>
<li>Not available in <code>VBScript</code></li>
<li>Returns <code>Null</code> for <code>Null</code> input (may be unexpected)</li>
<li>No option to reverse specific character ranges</li>
<li>Cannot specify custom reversal rules</li>
</ul>
        </article>
        
        <div style="margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-color);">
            <p>
                <a href="index.html">← Back to String</a> |
                <a href="../index.html">View all functions</a>
            </p>
        </div>

    </main>

    <footer>
        <div class="container">
            <p>&copy; 2024-2026 VB6Parse Contributors. Licensed under the MIT License.</p>
        </div>
    </footer>
</body>
</html>