Search code examples
androidsplit

Android split giving odd results


I have a string that contains a couple of GUID's and I am trying to split them out, however instead of the expected full field/string, I am getting only Characters/Bytes one at a time.

            String decodedQrText = qrCodeHelper.decodeQrFromUri(getContext(), attachment.internalUri);

            String[] separated = decodedQrText.split("|");
            String uGUID = separated[0];
            String uAPI = separated[1];
            String uEmail = separated[2];

decodedQrText =  e15457d9-7061-4ac5-ad74-179d5f8fb3ba|668afa73-2e5d-4860-a267-9889a247c1cd|[email protected]

String uGUID contains an "e"

String uAPI contains a "6"

String uEmail contains an "m"

as opposed to what I would expect would be the full chunk up to the | separater ?

What am I doing wrong ?

Thanks


Solution

  • I managed to resolve this by using the following

    String separated[] = decodedQrText.split("\\|");