0

I have a innertext like

<div contenteditable="true">
  hi</br>
  This is a multiple line</br>
  code
</div>

I want to make it a single line and instead of
take space and split it with comma.. I tried sTextbox.split(/[\s,]+/); but it include new line also please suggest me to solve this problem

UPDATED Expected output is like : hi this is a multipleline code.. I have to calculate sTextboxSplit[sTextboxSplit.length - 1] and it gives sTextboxSplit = ["hi", "this", "is", "multiple","line","code" ""], and in this it will give "" as my last index where it my last index is code. I want to work this in c# mvc..

ekad
  • 14,436
  • 26
  • 44
  • 46
Dhara
  • 1,914
  • 2
  • 18
  • 37

1 Answers1

0

You can use following regex :

>([^<]*?)<

Demo

This regex use Negated Character Classes to match any thing between > and < except <.

Community
  • 1
  • 1
Mazdak
  • 105,000
  • 18
  • 159
  • 188
  • My sTextbox value is `sTextbox = "bedrom0_1 people view↵t↵` and after applying ur suggestion m getting same ans.. – Dhara Jun 10 '15 at 13:11