Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regexp does not remove zeros at the beginning #619

Closed
TarasOsiris opened this issue May 27, 2016 · 0 comments
Closed

Regexp does not remove zeros at the beginning #619

TarasOsiris opened this issue May 27, 2016 · 0 comments

Comments

@TarasOsiris
Copy link

TarasOsiris commented May 27, 2016

    private String extractAppIdFromAppKey(String appId) {
        // take the second half of the 40 characters
        String working = appId.substring(20);

        // this removes leading 0's
        working = working.replaceFirst("^0+(?!$)", "");
        return working;
    }

This is the method that removes zeros from the beginning of the string, in Objective C it does not.

1) testAppIdExactly40SymbolsAndZerosInTheMiddle(im.getsocial.sdk.core.AppIdTest)
java.lang.AssertionError: 
Expected: "103456789"
     but: was "0103456789"

Version j2objc-0.9.8.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant