String manipulation & PDF output file

DanyVDanyV BC
edited November 2016 in .NET General

First of all, thank you for trying to help me. It should be simple (I think I am only missing something)
I have a htm file that it’s used to produce a pdf file and gets date from a screen selection
It is about string manipulation (extraction a substring that starts with “[“ from a string and displaying the result )
Example instead of Van5[15] it’s supposed to display Van

(Note: data for [RoomName], [ClassName]are variables that comes from a previous screen)
What I have tried:


<.body onload="extract()">

        <td colspan="2" style="text-align:center; font-size:80; font-family:Verdana; font-weight:bold;border:1px solid Black;">
        <.td colspan="2" style="text-align:center; font-size:60; font-family:Verdana; font-weight:bold;border:1px solid Black;">
            <.p id="demo"></p>  


<.script.>// <.![CDATA[
function extract() {
var str = "Van5 [14]";
return str.substring(0, str.lastIndexOf("["));

document.getElementById("demo").innerHTML = extract();
// ]]><./script>


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion