/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String barcode
= "35151022986022000105590000400630036591770797|20151013131745|21.26|";
String[] resp
= barcode.
split("\\|");
String cnpj
= resp
[0].
substring(6,
20); //são 14 digitos, iniciado da posicao 7
String coo
= resp
[0].
substring(31,
37); // supondo que tenham sempre 6 digitos
String data
= resp
[1].
substring(0,
8); // 8 primeiros digitos sao da data
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewogICAgICBTdHJpbmcgYmFyY29kZSA9ICIzNTE1MTAyMjk4NjAyMjAwMDEwNTU5MDAwMDQwMDYzMDAzNjU5MTc3MDc5N3wyMDE1MTAxMzEzMTc0NXwyMS4yNnwiOwogICAgICAgCiAgICAgICBTdHJpbmdbXSByZXNwID0gYmFyY29kZS5zcGxpdCgiXFx8Iik7CiAgICAgICAKICAgICAgU3RyaW5nIGNucGogPSByZXNwWzBdLnN1YnN0cmluZyg2LCAyMCk7IC8vc8OjbyAxNCBkaWdpdG9zLCBpbmljaWFkbyBkYSBwb3NpY2FvIDcKICAgICAgCiAgICAgIFN0cmluZyBjb28gPSByZXNwWzBdLnN1YnN0cmluZygzMSwgMzcpOyAvLyBzdXBvbmRvIHF1ZSB0ZW5oYW0gc2VtcHJlIDYgZGlnaXRvcwogICAgICAKICAgICAgU3Ry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