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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:12:13+00:00 2026-05-17T21:12:13+00:00

I am developing a login form with User ID. I want the user to

  • 0

I am developing a login form with User ID. I want the user to create the userid in a specified format. I need a method using C# to convert all lowercase letters to uppercase. The userid will be in the following fomat.
The format is:

xyz\t4z4567 (characters are not case sensitive)

Rules:

1.Only special character \ is allowed while creating user name.
2.The UserID sholud be converted to uppercase.like (xyz –> XYZ)
I need to check if user enters any special characters while creating the userid. If any special charcters are there in UserID the method needshold remove the special characters and should convert all lowercase to uppercase lettrs.

finally the result should be in the following way :

xyz\t4z45@67 —> XYZ\T4Z4567

I used the following method to check whether the string contains the following characters and if so i am replacing with empty.

public string RemoveSpecialChars(string str)
{
   string[] chars = new string[] { ",", ".", "/", "!", "@", "#", "$", "%", "^", "&", "*", "'", ";", "-", "_", "(", ")", ":", "|", "[", "]" };

    for (int i = 0; i < chars.Length; i++)
    {
        if (str.Contains(chars[i]))
        {
            str = str.Replace(chars[i], "");
        }
    }

    return str;
}
  • 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-17T21:12:13+00:00Added an answer on May 17, 2026 at 9:12 pm

    Use the following Regex replacement:

    outputStr = System.Text.RegularExpressions.Regex.Replace(inputStr, @"[^a-zA-Z0-9_\\]", "").ToUpperInvariant();  
    

    Input: inputStr=@"xya\t4z567"
    output: "XYA\T4Z567"

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

Sidebar

Related Questions

I am developing a login form with User Name and Password. I want the
I am developing a user login authentication, using jsp/servlets and glassfish v3. Basically the
I am developing an application in which I am using a login form at
I am developing client-server application in Java which need user login. For that I
I'm developing an iPhone application where I wish to authenticate (login form) on a
I am developing a PHP-based login system. Each user has an ID(a number) and
I'm developing an web application in Java and using facebook account for login to
I am using Spring Web MVC and Hibernate for developing my application. My login.jsp
I'm developing a web application using .net/c#/jQuery. I want to develop an AJAX function
I'am developing a module for Drupal which provides a login form and after submission

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.