<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<script type="text/babel">
const originalString = "/Hello, World!/";
// Function to remove the first and last characters
const removeFirstAndLastCharacter = (str) => {
// Handle cases where the string is too short to remove characters
// Use substring to remove the first and last characters
return str.substring(1, str.length - 1);
const modifiedString = removeFirstAndLastCharacter(originalString);
<div className='container'>
<h3>React Js Remove First and Last Character of String</h3>
<p>Original String: {originalString}</p>
<p>Modified String: {modifiedString}</p>
ReactDOM.render(<App />, document.getElementById("app"));
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);