This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import toDos from '../Store/ConfigureStore'; | |
const stateBefore = []; | |
const action = { | |
type: 'ADD_TODO', | |
id: 0, | |
text: 'Learn Redux' | |
} | |
const stateAfter = [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import toDos from '../Store/ConfigureStore'; | |
const stateBefore = []; | |
const action = { | |
type: 'ADD_TODO', | |
id: 0, | |
text: 'Learn Redux' | |
} | |
const stateAfter = [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
// var json = require("../passChildToParent/languages.json"); | |
var jsonArray = [ | |
{ | |
"code": "aaa", | |
"lang": "english" | |
}, | |
{ | |
"code": "aab", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleLangChange = () => { | |
var lang = this.myRef.current.value; | |
this.props.onSelectLanguage(lang); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor() { | |
super(); | |
this.myRef = React.createRef(); | |
} | |
render() { | |
return ( | |
<div> | |
<h5>Child Component : </h5> | |
<select ref={this.myRef} onChange={this.handleLangChange}> | |
<option selected='true'>--select-launguage--</option> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import SelectLanguage from './SelectLanguage'; | |
export default class ParentComponent extends React.Component { | |
state = { | |
language: '--select-launguage--', | |
}; | |
handleLanguage = (langValue) => { | |
debugger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
return ( | |
<div className="col-sm-4"> | |
<br></br> | |
<h4 > Parent Component: </h4> {this.state.language} | |
<hr></hr> | |
<div > | |
<SelectLanguage onSelectLanguage={this.handleLanguage} /> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string str = "`~@raked "; | |
string replaceChar = "%20"; | |
string output = hasSpecialChar(str, replaceChar); | |
Console.WriteLine(output); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string str = "`~@raked"; | |
bool flag = hasSpecialChar(str); | |
if (flag) | |
{ | |
Console.WriteLine("Yes"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("Enter the Chars"); | |
char[] chars = Console.ReadLine().ToCharArray(); |