#I'm having some issues with string manipulation

10 messages · Page 1 of 1 (latest)

tough flower
#

Alright so for some context Im working on a assignment to help get us Familiar more with string manipulation, I was under the impression that I was doing it right but since the code I used had more holes than a sinking ship I felt I should seek some help instead of trying to brute force it

stiff smeltBOT
#

This post has been reserved for your question.

Hey @tough flower! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

tough flower
#
import java.util.Scanner;


public class Stringmanipulation{
    public static void main(String[] agrs)
    String Username = "Andromeda";
    String otherUsername = "Shadius";
    int lengthOfString;
    char characterFromString;
    String substringFromString;

    System.out.println("Are the two strings equivalent? (same content):" +  Username.equals(otherUsername) );
    System.out.println("Computing how many characters are in the string" );
        
    System.out.println(Username + " = " + Username.length());
    System.out.println(otherUsername + " = " + otherUsername.length());

    System.out.println("Retrieving the character at index 0" );
    System.out.println(Username + " = " + Username.charAt(0));
    System.out.println(otherUsername + " = " + otherUsername.charAt(0));

    System.out.println("Getting a substring" );
    System.out.println(Username + " = " + Username.substring(3,7));
    System.out.println(otherUsername + " = " + otherUsername.substring(otherUsername.length() - 2));

}
humble venture
#

just put brackets in method

#

main(String[] args)
{
CODES HERE
}
@tough flower

tough flower
#

Ngl

#

i thought I did that

#

but i looked at my code i saw it was missing lol

#

Thanks homie