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 8766723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:37:26+00:00 2026-06-13T16:37:26+00:00

Auto increment for alpha numeric value in c#.net input text –> output text with

  • 0

Auto increment for alpha numeric value in c#.net

input text –> output text with increment +1

56755 –> 56756

56759 –> 5675a

5675z –> 56761

zzz –> 1111

  • 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-06-13T16:37:27+00:00Added an answer on June 13, 2026 at 4:37 pm

    Auto increment for alpha numeric ( alpha numeric ++)value in c#.net

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace AlphaNumeric
    {
        public class Program
        {
            public static void Main(string[] args)
            {
                var programObj = new Program();
    
                Console.WriteLine(programObj.AlphaNumericIncrement("56755")); //   56756
                Console.WriteLine(programObj.AlphaNumericIncrement("56759")); //   5675a
                Console.WriteLine(programObj.AlphaNumericIncrement("5675z")); //   56761
                Console.WriteLine(programObj.AlphaNumericIncrement("zzz"));   //   1111
    
                Console.ReadLine();
            }
    
            public string AlphaNumericIncrement(string text)
            {
                if (text == null || text.Trim().Length == 0)
                    return "1";
                else
                {
                    text = text.Trim();
                    string alphaNum = "123456789abcdefghijklmnopqrstuvwxyz";
                    var collection = text.ToLower().Trim().ToCharArray().Reverse().ToList();
                    bool isNextInr = true;
                    int l = collection.Count() - 1, i = 0;
                    while (isNextInr && i < collection.Count())
                    {
                        isNextInr = false;
                        switch (collection[i])
                        {
                            case 'z':
                                collection[i] = '1';
                                if (i < l)
                                    isNextInr = true;
                                else
                                    collection.Add('1');
                                break;
                            default:
                                collection[i] = char.Parse(alphaNum.Substring(alphaNum.IndexOf(collection[i]) + 1, 1));
                                break;
                        }
                        i++;
                    }
                    collection.Reverse();
                    return string.Join("", collection);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to auto increment the date value in vb.net? Name - asdf From Date
I am using auto increment value for the inserts in my table. But is
To mimic an auto-increment value in XQuery Update, the following works fine, assuming <root
Will the ID auto-increment value be reset if I drop (wipe) a MySQL table?
Possible Duplicate: Access Auto-Increment Value During INSERT INTO Statement I want to run an
I'm adding an auto increment column (called rowNum) to my table and it's working
I want to search person by auto increment ID (textbox and one button) .
Is it possible to have an auto-increment property but not an ID in JPA?
I would like to create an auto increment function that allows me to maintain
I am trying to auto increment my xml file. I have a form that

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.