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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:28:03+00:00 2026-05-27T04:28:03+00:00

EditText recEmail=(EditText)findViewbyId(R.id.email); EditText recPassword=(EditText)findViewbyId(R.id.password); String email=recEmail.getText().toString(); String password=recPassword.getText().toString(); The email and password contains the

  • 0
EditText recEmail=(EditText)findViewbyId(R.id.email);
EditText recPassword=(EditText)findViewbyId(R.id.password);
String email=recEmail.getText().toString();
String password=recPassword.getText().toString();

The email and password contains the white spaces at start,in or end of string if tab is pressed by mistake.

I need text out of white spaces, please help if you can.

Thanks in advance….!!!

  • 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-27T04:28:03+00:00Added an answer on May 27, 2026 at 4:28 am

    String.trim() is your friend.

    String email=recEmail.getText().toString().trim();
    String password=recPassword.getText().toString().trim();
    

    In the future, I highly recommend checking the Java String methods in the API. It’s a lifeline to getting the most out of your Java environment.

    As a general rule, I would not get rid of whitespace in the text. What if the user’s password starts or ends with a space? They will never be able to log in. I personally think you’re better off just leaving your code as is.

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

Sidebar

Related Questions

EditText ed1 = (EditText)findViewById( R.id.editText1 ); int a = Integer.parseInt( ed1.getText().toString() ); Does the
I have an EditText which takes a String from the user and a searchButton.
I have an EditText for an email field. My mobile screen is really small
Thsi is my code: EditText editCategoryName, editBrandName; private ArrayAdapter<String> myAdapter1, myAdapter2; @Override public void
i've some edittext and i'm checking the string inside it entered from users. when
I use an EditText with android:password=true to let the user type the password. Then
I have the following EditText preference <EditTextPreference android:key=pref_movies_min_year android:title=@string/pref_movies_min_year android:summary=@string/pref_movies_min_year_summary android:defaultValue=1950/> I need to
Our Sample Code EditText txtData = (EditText) findViewById(R.id.txtData); Button btnReadSDFile = (Button) findViewById(R.id.btnReadSDFile); btnReadSDFile.setOnClickListener(new
I have this code: EditText value = ( EditText )findViewById( R.id.editbox ); Integer int_value
I have one edittext EditText et1=(EditText)findViewById(R.id.EditText01); when i want to clear edittext i use

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.