Cody

Problem 1950. What's the News?

Solution 2162587

Submitted on 17 Mar 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
% % Non Reg Exp way of doing it % sourceCode=urlread('http://www.news.google.com'); startInd=strfind(sourceCode,'<span class="titletext">'); headline=sourceCode(startInd(1)+24:startInd(1)+150); headline=headline(1:strfind(headline,'</span>')-1) % % assert(isequal(getTheNews,headline))

Index exceeds the number of array elements (0). Error in Test1 (line 6) headline=sourceCode(startInd(1)+24:startInd(1)+150);

Suggested Problems

More from this Author4

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!