FAQ: Working with Text - Get Parts of Strings

I got stuck on Did you define an int named length ? on the second Instructions of C# Get Parts of Strings exercise even i input my code correctly!! what could i go wrong ?

Yeah I’m going to have to chime in with the others saying the instructions in this lesson are awful.

I don’t understand how I’m meant to find out if the char is equal to the letter it wants if I can’ use the EQUAL TO operator.

1 Like

My reply is pending review so I clicked view solution and it turns out the instructions ask a question for literally no reason and it just confuses you. It asks “Show your result in the console. Has there been a mutation?”, so I obviously assumed I’m supposed to show my result and answer the question in the console. Instead it just wants you to show what letter it is and that’s it. I don’t think I’m going to bother with this course any more, all it’s doing is frustrating the ■■■■ out of me.

2 Likes

Did you find the solution to this exercise?

You have stopPoint instead of length. It’s asking for the length variable which you did not make. Should be int length = tga + 3;

I think they’re overcomplicating what its asking. As the course did not touch on if statements yet, they shouldn’t be used. It’s asking you to view the output yourself and see IF there is a mutation or not. Just simply print the index and it should let you through.

  // define final strand
  string dna = startStrand.Substring(startPoint, length);


  // DNA mutation search
  Console.WriteLine(dna[3]);

No if statements required. I had a bit of issue at first using dna[length -1] cause of the example but realized it legit just wanted me to grab the index “dna[3]” and look at the output and see if there is a mutation or not.

But I do agree that the directions are somewhat misleading near the end.

2 Likes

For all the people that are coming to this course in 2024 or beyond. Scrolling through the comments it’s obvious the lesson has changed, however the forum link has not. I’m also reasonably confident the lesson is broken entirely.

They’ve added an AI Learning Assistant which is surprisingly helpful. I refreshed everything and went through with its instructions step by step, console prints correctly and step 4 still wont complete. I had thought maybe there was an error so tried swapped out the int startPoint = 0; section with int startPoint = tga; however this also didnt work.

The quality of this entire course really takes a nose dive around this point unfortunately. I’d like to be focused on making code that works, but I’ve instead spent two hours trying to figure out what imaginary box I’m meant to be checking to pass this section. Really bad impression for my 1st coding course with CA.

It’s probably worth noting that its taken me 15 hours of using this website to notice the ‘View Solution’ button. Ironically step 4 completes when using their code, however the build fails. 10/10

1 Like

Yes, the instructions are confusing. But just by looking at the screenshot, I guess you missed the part where it mentions to show the result of the fourth character to the console.. So, you should log that out to the console instead of logging other messages.