How to extract words from a delimited text string with "\\"?

0

I need to do a task where I should store words in an AVL, words taken from the following text:

A \ binary tree \ is a \ tree \ in which every \ node \ has a the most two children. These trees are very easy to implement in a programming language like \ java. | A \ binary search tree \ is a \ binary tree \ in which the elements stored in the following are fulfilled \ restrictions \

I have tried to use split and Sringtokens , but those methods divide me the complete text and what I need is only those words that are between "\".

Beforehand, thank you very much

------------------------- Applied code (SPLIT) ----------------- ---------

String [] palabras = texto.split("\\");
 for (int i = 0; i < palabras.length; i++){
  System.out.println(palabras[i]);
}
    
asked by Michael Navarrete Cartes 04.11.2018 в 20:31
source

0 answers