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

  • Home
  • SEARCH
  • 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 3609810
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:40:29+00:00 2026-05-18T21:40:29+00:00

I need to be able to convert user input to [a-z] roman characters ONLY

  • 0

I need to be able to convert user input to [a-z] roman characters ONLY (not case sensitive). So, there are only 26 characters that I am interested in.

However, the user can type in any “form” of those characters that they wish. The Spanish “n”, the French “e”, and the German “u” can all have accents from the user input (which are removed by the program).

I’ve gotten pretty close with these two extension methods:

    public static string LettersOnly(this string Instring)
    {
        char[] aChar = Instring.ToCharArray();
        int intCount = 0;
        string strTemp = "";

        for (intCount = 0; intCount <= Instring.Length - 1; intCount++)
        {
            if (char.IsLetter(aChar[intCount]) )
            {
                strTemp += aChar[intCount];
            }
        }

        return strTemp;
    }

    public static string RemoveAccentMarks(this string s)
    {
        string normalizedString = s.Normalize(NormalizationForm.FormD);
        StringBuilder sb = new StringBuilder();

        char c;
        for (int i = 0; i <= normalizedString.Length - 1; i++)
        {
            c = normalizedString[i];
            if (System.Globalization.CharUnicodeInfo.GetUnicodeCategory(c) != System.Globalization.UnicodeCategory.NonSpacingMark)
            {
                sb.Append(c);
            }
        }

        return sb.ToString();
    }

Here is an example test:

string input = "Àlièñ451";
input = input.LettersOnly().RemoveAccentMarks().ToLower();
console.WriteLine(input);

Result: "alien" (as expected)

This works for 99.9% of the cases. However, a few characters seem to pass all of the checks.

For instance, “ß” (a German double-s, I think). This is considered by .Net to be a letter. This is not considered by the function above to have any accent marks… but it STILL isn’t in the range of a-z, like I need it to be. Ideally, I could convert this to a “B” or an “ss” (whichever is appropriate), but I need to convert it to SOMETHING in the range of a-z.

Another example, the dipthong (“æ”). Again, .Net considers this a “letter”. The function above doesn’t see any accent, but again, it isn’t in the roman 26 character alphabet. In this case, I need to convert to the two letters “ae” (I think).

Is there an easy way to convert ANY worldwide input to the closest roman alphabet equivalent? It is expected that this probably won’t be a perfectly clean translation, but I need to trust that the inputs at FlipScript.com are ONLY getting the characters a-z… and nothing else.

Any and all help appreciated.

  • 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-18T21:40:29+00:00Added an answer on May 18, 2026 at 9:40 pm

    If I were you, I’d create a Dictionary which would contain the mappings from foreign letters to Roman letters. I’d use this for two reasons:

    1. It will make understanding what you want to do easier to someone who is reading your code.
    2. There are a small, finite, number of these special letters so you don’t need to worry about maintenance of the data structure.

    I’d put the mappings into an xml file then load them into the data structure at run-time. That way, you do not need to modify any code which uses the characters, you only need to specify the mappings themselves.

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

Sidebar

Related Questions

I need to be able to quickly convert an image (inside a rails controller)
I need to be able to get a list of the groups a user
I am trying to convert a VISUAL USER OBJECT that was once embedded on
I need to be able to create basic MS Project items (tasks, projects, resources,
I need to be able to get at the full URL of the page
I need to be able to merge two (very simple) JavaScript objects at runtime.
I need to be able to load the entire contents of a text file
I need to be able to GZip compress a file in an Excel VBA
I need to be able to periodically send email alerts to subscribed users. PHP
I need to be able to take a string like: '''foo, bar, one, two,

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.