How to use CSS to cut text when finding a specific character?

0

How to use CSS or webkit to cut text when finding a specific character?

For example ... the following text:

  "The success of Judge Sérgio Moro is so great that a tourism agency in the state of Paraná has created a package that aims to attract customers with Lava Jato routes. According to the column by Mônica Bergamo, Folha de S. Paulo newspaper, the package takes people to the places where the investigations are carried out in the city of Curitiba.The itinerary lasts five hours and tourists visit the Attorney General's Office and then to the places where Judge Sergio Moro of the 13th Federal Court attends : the Federal University of Paraná, "where he teaches", and the seat of the Federal Court. "

I would like to cut when I find the first point . . It would look like this:

  

"The success of Judge Sérgio Moro is so great that a tourism agency in the state of Paraná has created a package that aims to attract customers with Lava Jato routes."

Is this possible?

    
asked by anonymous 30.01.2017 / 17:56

1 answer

1

CSS face is just for "beauty".

In case of tighter processing so I think I should use a back language or javascript. most of the languages (not all of them) have a function called "split" where you delimit to where you want to break a particular string, in case you would break at that point, the split returns you an array, then theoretically that excerpt referring to the first point would be in position 0. Here's an example

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display the array values after the split.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var str = "O sucesso do juiz Sérgio Moro é tanto que uma agência de turismo do estado do Paraná criou um pacote que visa atrair clientes com rotas da Operação Lava Jato. Segundo a coluna de Mônica Bergamo, do jornal Folha de S. Paulo, o pacote leva as pessoas para conhecerem os locais onde se desenrolam as investigações, na cidade de Curitiba. O roteiro dura cinco horas e os turistas visitam a Procuradoria-Geral da República e depois aos locais onde o juiz Sergio Moro, da 13ª Vara Federal frequenta: a Universidade Federal do Paraná, onde leciona, e a sede da Justiça Federal.";

    var res = str.split(".");
    document.getElementById("demo").innerHTML = res[0];
}
</script>

</body>
</html>
    
30.01.2017 / 19:17