Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6752481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:03:00+00:00 2026-05-26T13:03:00+00:00

I’m trying to display the Persian alphabet in the Debug window in order. Once

  • 0

I’m trying to display the Persian alphabet in the Debug window in order. Once it reaches the final letter, subsequent letters will be multiplied by the group they are in. So, for example, if I want to display alef (ا) – Persian for the letter “A”, I would start with the index of 1. If I reach an index of 33 (Persian has 32 letters), it should display (اا).

The code below works just fine for the Latin alphabet (e.g. “abcdefj…”), but with Persian/Arabic, I’ve got two problems.

  1. It gives a count of 33 instead of 32 – i.e. after the letter “ه” it
    produces a blank character. I suspect it is this, but don’t
    know how to account for it.
  2. For characters that need to double up, like “ش ش” (without the
    space) it shows as “شش”.

    Sub Main()
        Dim t As New PersianAlphabet
        For i = 1 To 50
            Debug.WriteLine(t.NextLetter())
        Next
    End Sub
    
    Public Class PersianAlphabet
        Private charArray As String
        Private charCount As Integer
        Private CurrentNumber As Integer = 0
        Sub New()
            'Dim charArray1() = {"ا", "ب", "پ", "ت", "ث", "ج", "چ", "ح", "خ", "د", "ذ", "ر", "ز", "ژ", "س", "ش", "ص", "ض", "ط", "ظ", "ع", "غ", "ف", "ق", "ک", "گ", "ل", "م", "ن", "و", "ه‍", "ی"}
            'Dim joined As String = String.Join("", charArray1)
            'Me.charArray = joined
            Me.charArray = "ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوه‍ی"
            Me.charCount = charArray.ToCharArray.Count
        End Sub
        Public Function NextLetter(Optional ByVal StartAt As Integer = 1) As String
            Dim count = (Me.CurrentNumber + StartAt)
    
            Dim divisor = count / Me.charCount
            Dim outstring As New StringBuilder
    
            If divisor <= 1 Then
                outstring.Append(charArray(Int32.Parse(count - 1)))
            Else
                Dim tempAlphaCount = Int(divisor) + 1
                Dim groupRange = Int(divisor) * Me.charCount
                Dim alphaIndex = count - groupRange
                If alphaIndex = 0 Then
                    tempAlphaCount = tempAlphaCount - 1
                    alphaIndex = Me.charCount
                End If
                alphaIndex -= 1
    
                For i = 0 To tempAlphaCount - 1
                    outstring.Append(charArray(Int32.Parse(alphaIndex)))
                Next
            End If
    
            Me.CurrentNumber += 1
            Return outstring.ToString
        End Function
    End Class
    

Has anyone dealt with these two kinds of issues before? Any thoughts/advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:03:00+00:00Added an answer on May 26, 2026 at 1:03 pm

    Figured out that there is a Unicode of 2805 (not 2804 as expected) within the string. Removing that gives the correct count. Putting that between two letters also allows for non-joining letters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.