Skip to content

Instantly share code, notes, and snippets.

View MahmoudElmasry7's full-sized avatar

MahmoudElmasry7

View GitHub Profile
class Calculator{
static double add(double a,double b){
return a+b;
}
static double sub(double a,double b){
return a-b;
}
static double mul(double a,double b){
return a*b;
int check(String text) //1
{
if(text.length%2==0){
print("even");
}
else{
print("odd");
}
return text.length;
}
void main(){
String Mail= "mahmoud2006elmasry@gmail.com";
RegExp reg= RegExp(r"^[^\.\*\-\+\/\\][\w.]{10,30}[^\.\*\-\+\/\\]@(gmail|yahoo)\.com$");
print (reg.hasMatch(Mail));
print("--------");
String Url= "http://github.com";
RegExp reg2= RegExp(r"^(http|https)://[^\.\*\-\+\/\\\#][\w./]{4,}\.(com|org|net|io|gov|edu|dev|eg)$");
print(reg2.hasMatch(Url));
void main(){
int size=3;
for(int i=0;i<size;i++){
String dash="";
String or="";
for(int j=0;j<size;j++){
dash+=" ---";
or+=" | ";
}
void main()
{
Map page={
"header":{
"top":{
"title":"company logo","nav":["Home","About","Products","Contact Us"]
},
"body":{
"title":"company Name",
//image url:https://cdn.venngage.com/template/thumbnail/full/98c75d47-f5a4-40a6-9913-d2be2659dc4c.webp
void main()
{
var page=[
{"product name":"office chair","description":"ergonomic office chair with lumber support","usd":120,"minimum quantity":10,"notes":"bulk discount available"},
{"product name":"conference table","description":"6-foot conference table with metal legs","usd":450,"minimum quantity":5,"notes":"custom sizes available"},
{"product name":"desktop computer","description":"intel i5,8gb ram,256 gb ssd","usd":750,"minimum quantity":15,"notes":"include one-year warrantly"},
{"product name":"printer","description":"color laser printer,wirless","usd":200,"minimum quantity":20,"notes":"includes 2 toner cartidges"},
{"product name":"whiteboard","description":"4*6feet(1.83m),magnetic surface","usd":180,"minimum quantity":8,"notes":"installation included"},
{"product name":"filing cabinet","description":"4-drawer vertical filing cabinet","usd":150,"minimum quantity":10,"notes":