String.split is not a function (js). RRS feed

  • Question

  • var blockhours = blockHoursList.responseJSON[i]; //{hours: "10:00 - 12:00"} var parse = blockhours.split('-'); // split is not a funtion

    var eventStart = parse[0];
    var eventEnd = parse[1];

    Code is breaking at line #2
    • Moved by CoolDadTx Wednesday, October 30, 2019 2:05 PM ASP.NET related
    Wednesday, October 30, 2019 1:45 PM

All replies

  • This forum is for C# questions only. Please post questions related to web development in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Wednesday, October 30, 2019 2:05 PM
  • Hello,

    This forum is for C#, not scripting languages, in the future please keep questions to C#.

    Now this is an example that work.

        $(document).ready(function (e) {
            var name = "Karen,Payne";
            var results = name.split(',');
            console.log(results[0] + ' ' + results[1]);

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Wednesday, October 30, 2019 2:07 PM