Java: Remove brackets / leading slashes from String

My Android-app have always presented the DNS-Server(s) with brackets / leading slashes like:

How can we get rid of these unnecessary characters ?

String myIp2Dns1:

String myIp2Dns1 = String.valueOf (LinkProp.getDnsServers()) ;

Log:

Log.d("myDnsInfo - Domain - ", "Domain = " + LinkProp.getDomains());
D/myDnsInfo: dns = [/10.0.2.3]

Solution:
Manipulation of String myIp2Dns1:

myIp2Dns1 = myIp2Dns1.replaceAll("[\\[\\](){}\"^/+\"]","");

This command removes brackets / slashes / backslashes from the String.

The output looks much better now:

show root-cause for compile-message: Recompile with -Xlint:deprecation for details

if the compile-output shows something like:

Recompile with -Xlint:deprecation for details

Build-Output

Then it is time to get to the details of this message:

in Gradle-scripts/build.gradle (Project) include the following line(s):

tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
build.gradle example

When you now run the app the root-cause is shown in the output:

example of build-output

Done

Error when adding Firebase to your app

When you add Firebase to your app and get similar error-messages like:

Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:26.1.0)

Then add the following two lines in graddle.properties:

android.useAndroidX=true
android.enableJetifier=true