null char elimination

the program i'm working with will display two file names, null is in the name, how do i get that out?

I think it with this line of code that things are getting messed up
if(sorter1[i].charAt(i) != ' ') {

Since ' ' does not = null and you can't have null == char, i'm not sure what will work

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


s = s.replace("\x0", "");
Should be replaceAll
s = s.replaceAll("\0", "");

works well enough

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

no158Author Commented:
I'm working with a String array
sorter1[i] = sorter[i].replaceAll("\0", "");

is giving me output that looks like:
>>is giving me output that looks like:

Not sure what your point is ...
It will eliminate null chars
no158Author Commented:
Off set the string by 4 char's and it fixed this problem, for some reason the replaceAll code was not doing its job deep within loops. Ill have to fine comb this later but for now I need to have a working product.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.