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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:56:55+00:00 2026-05-15T23:56:55+00:00

Have an email, want to remove the first @ symbol from it, to then

  • 0

Have an email, want to remove the first “@” symbol from it, to then make sure it doesn’t have more then one in the second check. Here is currently how I’m doing it.

Dim tempEmail As String = ContactEmail
Dim count As Integer = 0
If tempEmail.IndexOf("@") <> -1 Then 'check for one
    count += 1
    tempEmail.Remove(tempEmail.IndexOf("@"), 1)
End If
If tempEmail.IndexOf("@") <> -1 Then 'check for two
    count += 1
End If

If count = 1 Then
    JustifyString(ContactEmail, 66, " ", LEFT_JUSTIFY)
Else
    ContactEmail = BLANK_EMAIL
End If

But after debugging, I have found that it never actually removes the “@” symbol from the string from tempEmail. Why?

  • 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-15T23:56:55+00:00Added an answer on May 15, 2026 at 11:56 pm

    String is immutable. All String methods do not alter the String, but instead they create a new one and return it. Try this instead:

    tempEmail = tempEmail.Remove(tempEmail.IndexOf("@"), 1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF web service. I want to send email from this service.
I have 2 textboxes (one above another) and I want to remove the gap
Let's say I have some email: some_email@yahoo.com . Firstly I would want to remove
I want to check some string before sending an email. I have 3 fields:
I have email addresses like user1@gmail.com , user2@ymail.com user3@hotmail.com ... etc. I want a
I want to throw an exception to say that we have an invalid email
I have a form that validates the email address and I want to be
I have a daily cron job that email PDFs to customers. I want to
I have a form with a name and an email address. I want a
I have an email address enclosed in single quotes: $email = 'test@email.com'; I want

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.