0

Total noob here.

I just started learning java and would like to create a program so my teacher does not need to count everyone just to figure out who is missing.

For this, I would need input data. We use teams to learn java so the people who are attending could write something in chat so the teacher can copy/paste this as input data for my program.

This is what I already have:

    String names = "Tupac Shakur,Randy Bobandy,Michael Scott,Randy Marsh,Leslie Knope,you mum gey,no u";

    String[] arr = names.split(",");
    System.out.println("Bot NaniPoonani: Who is here Tool v1 ");
    System.out.println("Bot NaniPoonani: Copy/paste the chat data here: ");
    Scanner inputNames = new Scanner(System.in);
    String ScanNames = inputNamen.next();


    String[] FilterdInputNames = ScanNamen.split(Arrays.toString(arr));

    String[] FilterdNames = names.split(",");

    for (String ss : arr);
    System.out.println(" ");
    System.out.println(" ");
    System.out.println(" ");
    System.out.println(" ");

    System.out.println(Arrays.toString(FilterdInputNames));
}

This code did not work how I expected and I'm kinda blocked. The second problem is the chat input is filled with not need data, here is an example:

> [Yesterday 4:44 PM] Tupac Shakur
    
Ja Patrick..
​[Yesterday 4:45 PM] James Bond
    cya
​[Yesterday 4:45 PM] Nikola Tesla
    laters
​[Yesterday 4:45 PM] Pewdie Pie
    
ok
​[Yesterday 4:45 PM] Huge Anus
    Bedankt, MabOI!
​[Yesterday 4:45 PM] Humong Gus
    
Dank u wel !! (smile)
​[Yesterday 4:45 PM] Boby Lee
    Tot morgen
​[Yesterday 4:45 PM] Mister Lahey
    tot donderdag
<https://teams.microsoft.com/l/message/19:[email protected]/1617115470132?tenantId=73c18a3-ce77-4292-94ad-b1ce04645b22&amp;parentMessageId=1617089369488&amp;teeatedTime=1617115470132>
> Blockquote

My first thought was that I could use .split to fill an array with each name using the not needed data

[Yesterday 4:44 PM] Tupac Shakur (enter or /n )

something like this: String[] FilterdInputNames = ScanNamen.split("M]" + "/n"); But clearly, that's not how slipt works.

All advice is welcome since I am not even sure if I need to filter the not needed data.

Thank you in advance

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.