#Log Analysis

20 messages · Page 1 of 1 (latest)

normal finch
#

hi i'm stuck whit this exercise,evry time i write something the program give me the same error

wheat elbow
#

Hi, if you share your code and your error message (in code blocks - use 3x backticks before and after) it's way easier to help than just guessing 😉

light moth
#

What language are you writing in?

boreal adderBOT
#

How you ask questions makes a huge difference in the help we can provide. Learn how to write good support requests in this article: http://bit.ly/howto-ask

normal finch
normal finch
wheat elbow
#

Is this the entire code or is there something missing?
If this is the entire code, would you share the error message too?

PS: The backticks i mentioned earlier, if you use them you get a better formating for your code
like this

wheat elbow
#

depending on what keyboardlayout you use, try to find the key that has a ´ and below that a ` symbol

#

us keyboards have if tleft to the 1 key

normal finch
#

okok meanwhile i write the entire code and now it work but i don't understand the previus error ahahah
this is my new code
`public static class LogAnalysis
{
public static string SubstringAfter(this string log ,string delimiter)
{
return log.Split(delimiter)[1];
}
public static string SubstringBetween(this string log ,string d1 , string d2)
{
return log.Split(d1)[1].Split(d2)[0];
}
public static string Message(this string log )
{
return log.SubstringAfter(": ");
}

public static string LogLevel(this string log )
{
    return log.SubstringBetween("[","]");
}

}`

#

There is a way to write it better?

tame rune
#

And which test is failing? What’s the output?

light moth
tame rune
#

I don’t see a string array being returned. Each split is followed by an element being retrieved.

normal finch
#

i think..😅

tame rune
#

Ah, I missed that the latest code snippet was one that passed the tests, not the code that was incorrect. Ignore my last comment which was directed at glennj.

As for feedback on a passing solution, that's what mentoring sessions are intended for on the website. This channel is for getting unstuck on an exercise, and the tests pass so you're good to go.

boreal adderBOT