DEV Community

Anjali Gurjar
Anjali Gurjar

Posted on

" '"" replace in. js

function trimquest(str){
return str.replace(/^([' "])(.*)\1$,'$2')

function sec(str){
const seg=str.split('.' );
if(seg.length<2){
return ''}
return seg[seg.length-2]

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs