import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calculator implements ActionListener{ JFrame frame; JTextField textfield; JButton[] numberButtons = new JButton[10]; JButton[] functionButtons = new JButton[9]; JButton addButton,subButton,mulButton,divButton; JButton decButton, equButton, delButton, clrButton, negButton; JPanel panel;
Font myFont = new Font("Ink Free",Font.BOLD,30);
double num1=0,num2=0,result=0; char operator;
Calculator(){
frame = new JFrame("Calculator"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(420, 550); frame.setLayout(null);
textfield = new JTextField(); textfield.setBounds(50, 25, 300, 50); textfield.setFont(myFont); textfield.setEditable(false);
addButton = new JButton("+"); subButton = new JButton("-"); mulButton = new JButton("*"); divButton = new JButton("/"); decButton = new JButton("."); equButton = new JButton("="); delButton = new JButton("Del"); clrButton = new JButton("Clr"); negButton = new JButton("(-)");
it would be more easy to understad for beginners like me if you go slower than usual.. because i don't understand many terms like "ActionListener", interfaces etc.. it's like new to me since I'm a beginner..
@NOA777 the method Double.parseDouble() casts a value to a double type value. the getText() method is used to get the text from the text field. So Double.parseDouble(txtfield.getText()) is actually casting the string values to a double type value of whatever is written in the rext field as we can't perform calculation with string type of values.
I had a few problems with this application and I fixed one. It looks like when you use the negative button you can't click it first then click the number button you want to be negative. It will cause the program to crash. To fix this problem you can use a try and catch method plus a NumberFormatException. The NumberFormatException is an unchecked exception in Java that occurs when an attempt is made to convert a string with an incorrect format to a numeric value. Therefore, this exception is thrown when it is not possible to convert a string to a numeric type (e.g. int, float). It has this problem with negative values. However, the negative button works when you click the number button first then click the negative button. I still put this exception in just in case someone clicks the negative button first. It isn't a great fix because I would like the negative button to work both ways so it won't matter which you click first the number or the negative button. When I figure this out then I will update folks. First, I will attempt to replicate what my phone calculator does with negative buttons. They have a +/- option that has a few different behaviors that I can implement. The second problem I identified is that the functionality of the negative button doesn't work. I checked Bro Code's source code and copied then pasted it on my Eclipse file but still has the same problem. I knew it would but I wanted to make sure it wasn't just me. When you trying adding or multiplying or dividing a number against a negative number it will convert the negative number to -1. No matter what value your negative number is. For example it's -8, it will convert it to -1. Example 1, 3 * -8 = -24, but the calculator will process the equation like this: 3 * -1 = -3. I think maybe I can add a case to the switch statement so I'm going to try that first. Or I can add a loop to the negative button to address the -1 problem. As I said before, when I have solutions for this then I will post it to my comment thread.
Update: I found a solution to the problem I identified with negative numbers. This solution I tested and it works. Negative value numbers won't automatic be converted to -1 but will have the value you intended. Code: if (e.getSource() == negButton) { double num = Double.parseDouble(textfield.getText()); if (num >= 0) { double resultneg = num * -1; textfield.setText(resultneg + " "); } else { double resultpos = num * -1; textfield.setText(resultpos + " "); } If you notice I changed the button to no longer just be a negative button but a +/- button. I did this because of the calculator apps today on phones and computers are setup with +/- functions.
@@halimaomar9820 if else condition to check num > 0 or less than or equal to zero , pretty much does the same function as the original bro code.Though it checks explicitly,the results are the same Btw, the two possible errors that you have spotted out are correct but unfortunately there is no solution for those in your code
This tutorial was very good and even gave the challenge of fixing the Delete and Clear font size while keeping the rest of the numbers and functions font the same size
00:03 How to make a simple calculator program using Java 03:50 Creating a Java calculator app with J buttons and J panel 07:05 Adding text field and buttons to the calculator app 10:42 Creating an array of JButtons 14:32 Adding delete and clear buttons to the calculator app interface. 17:54 Adding buttons to the panel 21:34 Adding functionality to decimal button and various math operations 26:25 Implementing Clear and Delete functionality in Java calculator app 30:17 Added functionality to the negative button, allowing the user to flip the sign of the number displayed in the text field. 33:44 How to make a very simple calculator using Java
This channel is so underrated I went through many tuto on youtube, but none of them was that good(sincerely), and this is in regards to any programming language This developer is Gold
u can add this also to prevent adding more than one decimal point if (e.getSource() == decButton) { //programming the decimal buttons String temp = textField.getText(); if (!temp.contains(".")) { //preventing adding more than one cecimal textField.setText(temp + "."); } }
Thanks a lot. I need another help. I want to add the feature that is if I press Clr button it should show 0. I can easily do this by just putting textfield.setText("0"); in the clr button function. But the problem arises after that. If any number is given as input after pressing Clr button the zero stays before them, I want the zero disappear if any button is pressed after that. How can I do so?
This is an amazing tutorial, thumbs up. I would have loved to see how you handled division by 0. I have also noticed that its possible to have multiple dots in a number which would result in an error during calculations.
little bit late, but came across the tutorial right now. for multiple dots I did (most likely theres a better solution): if(e.getSource() == decButton) { boolean alrDec = false; for(int i = 0; i
for delete button use below code:- if(e.getSource()==delButton) { String string = textfield.getText(); textfield.setText(string.substring(0,string.length()-1)); } everytime it will delete the last elemnt of the string.
I just begun with Java and made my own calculator like this. But after finishing and seeing this video, there is a lot of things I could do to definetly reduce my code size.
Small bug, when deleting characters you actually move the initial character along the string. So eventually your input will reach the other end of the textField. To recreate this; Input any number of digits and then delete until the last one, do this over and over to move your output. I implemented a small fix for this in my code, seen below; if(e.getSource() == delButton){ String str = textField.getText(); textField.setText(" "); for(int i = 0; i < str.length() - 1; i++){ String strnew = str.substring(0, str.length()-1); textField.setText(strnew); } } Implementing this substring code deletes the last character from the Char array but does not move the initial Char preventing the bug from occurring! This was a really cool tutorial! Props to Bro Code for making this! Was perfect as I couldn't get JavaFX to work on my machine! I hope this helps.
Here's another tip: In place of "String.valueOf(double number)", you could've also used "Double.toString(double value)" to achieve much the same results. The question remains though, what is the difference between the two, if any?
i just finish second book about java. A Beginners Guide and Complete Reference from Herbert SCHİLDT. I was looking for an example of real GUI software that wasn't beyond my knowledge and actually did something. So I could get an idea of the general programming structure. Your video help me a lot about this. Thank you.
In new in java , I found that you can type 0,3,4,5,56,6 it take me some time to fix it , also remove 5+2= 7.0 , now working on implement the keyboard . Oh , and eliminate the empty space every time you push +or / or whatever operator.
Dear Bro you are simply amazing... ❤❤💐💐being sooo... generous in sharing your wealth of knowledge and you certainly deserve a very big appreciation for making me impressed to learn Java programming. God Bless You Bro...🙏🙏. I really loved it and impatient to try it ASAP..... 👌👌👍👍
Q1) How can you make the -ve button, clear btn and del btn fit ? Q2)how to prevent someone from hitting the decimal btn twice ? This tutorial is great, how about a simple note taking Api ?
Q2: You could implement a method which checks if a String includes a ' . ' and if so the method returns true. Then you add that Method to the decimal button inside of an if-statement that checks if the String of the TextField includes a ' . ' which then "returns" so the button does nothing by clicking it :D i did it like this: this is the method i wrote( make sure its in the class body of the Calculator): private static boolean decimalCheck(String s) {
for(int i = 0; i < s.length(); i++) {
if(s.charAt(i) == '.') { return true; }
}
return false; } and my decimalButton: if(e.getSource() == decButton) {
I followed through this whole tutorial on Linux with text editor and terminal Javac compiling (no IDE!) and it worked flawlessly even when packaged into a jar file. I feel like I learned stuff but even if I didn’t, I at least understand how the program works and it was fun to feel like I’m coding stuff just by following along
thanks for the video. for the decimal point button, i added a little bit of if statement to prevent the program from adding more dots to the textfield: if(e.getSource()==decButton) { String myString = textfield.getText(); if (!myString.contains(".")) { // Check if there is no dot already present textfield.setText(textfield.getText().concat(".")); } }
To make sure there's only one decimal point in the number I changed the body of the if statement for the decimal button to the following: boolean hasDecimal=false; String string=textField.getText() ;
side note I named my text field as "textField" with camel case which is different from how Bro named his ("textfield"); make sure to change that if you copied Bro's variable names exactly!
Wow even though your style is different, its super easy to understand and frankly, might make me do my calculator over just because It seems easier the way you did it
import javax.swing.AbstractAction; import java.awt.AWTError; import java.awt.AWTEvent; My Netbins adds(the last dot continuations) to the original code.How can i fix this?.
Wonderful video! This series has been really helpful in training my way of thinking too! Sometimes I pause the video and finish the line or piece of code before starting the video again so I can check it. Thank you so much for the effort! For the delete-button Action-listener, I wrote these alternative lines btw. if(e.getSource()==delButton) { textField.setText(textField.getText().substring(0,(textField.getText().length() - 1))); } It takes the text in the textfield and replaces it with a substring that leaves out the last index. This way you don't need to create a for-loop and you can do it with one line instead! I really learned this way of thinking through practicing with your videos - so thanks a lot! :D
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Calculator implements ActionListener{
JFrame frame;
JTextField textfield;
JButton[] numberButtons = new JButton[10];
JButton[] functionButtons = new JButton[9];
JButton addButton,subButton,mulButton,divButton;
JButton decButton, equButton, delButton, clrButton, negButton;
JPanel panel;
Font myFont = new Font("Ink Free",Font.BOLD,30);
double num1=0,num2=0,result=0;
char operator;
Calculator(){
frame = new JFrame("Calculator");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(420, 550);
frame.setLayout(null);
textfield = new JTextField();
textfield.setBounds(50, 25, 300, 50);
textfield.setFont(myFont);
textfield.setEditable(false);
addButton = new JButton("+");
subButton = new JButton("-");
mulButton = new JButton("*");
divButton = new JButton("/");
decButton = new JButton(".");
equButton = new JButton("=");
delButton = new JButton("Del");
clrButton = new JButton("Clr");
negButton = new JButton("(-)");
functionButtons[0] = addButton;
functionButtons[1] = subButton;
functionButtons[2] = mulButton;
functionButtons[3] = divButton;
functionButtons[4] = decButton;
functionButtons[5] = equButton;
functionButtons[6] = delButton;
functionButtons[7] = clrButton;
functionButtons[8] = negButton;
for(int i =0;i
it would be more easy to understad for beginners like me if you go slower than usual.. because i don't understand many terms like "ActionListener", interfaces etc.. it's like new to me since I'm a beginner..
Nice👍🔥
@@komaltandle465 LOL
@NOA777 the method Double.parseDouble() casts a value to a double type value. the getText() method is used to get the text from the text field. So Double.parseDouble(txtfield.getText()) is actually casting the string values to a double type value of whatever is written in the rext field as we can't perform calculation with string type of values.
@NOA777
The method parseDouble() of wrapper class Double, convert string to double.
People are missing out on your amazing content. I am still learning Java, and your content helps a lot.
how are you now on your Java journey?
@@Bryysanity Im curious too
Came here straight after the 12 hour java tutorial. You are Awesome Bro. Keep 'em coming :)
I had a few problems with this application and I fixed one. It looks like when you use the negative button you can't click it first then click the number button you want to be negative. It will cause the program to crash. To fix this problem you can use a try and catch method plus a NumberFormatException.
The NumberFormatException is an unchecked exception in Java that occurs when an attempt is made to convert a string with an incorrect format to a numeric value. Therefore, this exception is thrown when it is not possible to convert a string to a numeric type (e.g. int, float). It has this problem with negative values.
However, the negative button works when you click the number button first then click the negative button. I still put this exception in just in case someone clicks the negative button first.
It isn't a great fix because I would like the negative button to work both ways so it won't matter which you click first the number or the negative button. When I figure this out then I will update folks. First, I will attempt to replicate what my phone calculator does with negative buttons. They have a +/- option that has a few different behaviors that I can implement.
The second problem I identified is that the functionality of the negative button doesn't work. I checked Bro Code's source code and copied then pasted it on my Eclipse file but still has the same problem. I knew it would but I wanted to make sure it wasn't just me.
When you trying adding or multiplying or dividing a number against a negative number it will convert the negative number to -1. No matter what value your negative number is. For example it's -8, it will convert it to -1. Example 1, 3 * -8 = -24, but the calculator will process the equation like this: 3 * -1 = -3. I think maybe I can add a case to the switch statement so I'm going to try that first. Or I can add a loop to the negative button to address the -1 problem.
As I said before, when I have solutions for this then I will post it to my comment thread.
Update: I found a solution to the problem I identified with negative numbers. This solution I tested and it works. Negative value numbers won't automatic be converted to -1 but will have the value you intended.
Code:
if (e.getSource() == negButton) {
double num = Double.parseDouble(textfield.getText());
if (num >= 0) {
double resultneg = num * -1;
textfield.setText(resultneg + " ");
} else {
double resultpos = num * -1;
textfield.setText(resultpos + " ");
}
If you notice I changed the button to no longer just be a negative button but a +/- button. I did this because of the calculator apps today on phones and computers are setup with +/- functions.
Full solution code fixing all the bugs/errors:
try {
if (e.getSource() == negButton) {
double num = Double.parseDouble(textfield.getText());
if (num >= 0) {
double resultneg = num * -1;
textfield.setText(resultneg + "");
} else {
double resultpos = num * -1;
textfield.setText(resultpos + "");
}
}
}
catch (NumberFormatException num) {
System.out.println(
"NumberFormatException occurred");
}
@@halimaomar9820 if else condition to check num > 0 or less than or equal to zero , pretty much does the same function as the original bro code.Though it checks explicitly,the results are the same
Btw, the two possible errors that you have spotted out are correct but unfortunately there is no solution for those in your code
Started practice with GUI's and this helped a lot!
off course same here bro😎
Extremely helpful. Got my mini project done within 30 minutes referring your source code and guide. Thankkksss a lotttt ☺👏
Most impressive. Very lucid coding. Congrats on teaching me a little more than I knew!
Bro You are legend. I am not a student I started learning JAVA to make my travel agency CRM.
This tutorial was very good and even gave the challenge of fixing the Delete and Clear font size while keeping the rest of the numbers and functions font the same size
Please, don't stop!!! More and more tutorials!!!!
the first sentence (Please, don't stop!!) remember me of a chat i had i chai 😏😏
@@Zito_from_OHIO
you are really a great teacher you have made my life easy hahahah... God bless you sir
00:03 How to make a simple calculator program using Java
03:50 Creating a Java calculator app with J buttons and J panel
07:05 Adding text field and buttons to the calculator app
10:42 Creating an array of JButtons
14:32 Adding delete and clear buttons to the calculator app interface.
17:54 Adding buttons to the panel
21:34 Adding functionality to decimal button and various math operations
26:25 Implementing Clear and Delete functionality in Java calculator app
30:17 Added functionality to the negative button, allowing the user to flip the sign of the number displayed in the text field.
33:44 How to make a very simple calculator using Java
Thank you, Bro! My prayers to the algorithm.
I knew bro couldn't miss the negative sign before. He just cares for us bros and was testing us to grow stronger💪
This channel is so underrated
I went through many tuto on youtube, but none of them was that good(sincerely), and this is in regards to any programming language
This developer is Gold
Incase you guys didnt know, calc is short for calculator, im just speaking in slang...
You always perfect sir because your way of teaching is all the time perfect. Thank you so much sir.🥰
u can add this also to prevent adding more than one decimal point
if (e.getSource() == decButton) {
//programming the decimal buttons
String temp = textField.getText();
if (!temp.contains(".")) {
//preventing adding more than one cecimal
textField.setText(temp + ".");
}
}
Thanks a lot. I need another help. I want to add the feature that is if I press Clr button it should show 0. I can easily do this by just putting textfield.setText("0"); in the clr button function. But the problem arises after that. If any number is given as input after pressing Clr button the zero stays before them, I want the zero disappear if any button is pressed after that. How can I do so?
You are a true Bro. Thank you very much sir! Everyone keep commenting, liking and subbing to help the algorithm!
This is an amazing tutorial, thumbs up. I would have loved to see how you handled division by 0. I have also noticed that its possible to have multiple dots in a number which would result in an error during calculations.
if(e.getSource() == decButton)
{
if(textfield.getText().contains("."))
{
String temp = textfield.getText();
textfield.setText("");
for(int i=0;i
little bit late, but came across the tutorial right now.
for multiple dots I did (most likely theres a better solution):
if(e.getSource() == decButton) {
boolean alrDec = false;
for(int i = 0; i
Thank you very much for your assistance, you explained the code perfectly. Thumb Up.
I just start learning java a month ago and a little bit confuse what to do, and i found your channel, its really help me to practice
for delete button use below code:-
if(e.getSource()==delButton) {
String string = textfield.getText();
textfield.setText(string.substring(0,string.length()-1));
}
everytime it will delete the last elemnt of the string.
Your programme is not right bro
@@AnsarAbbas-ed5ig bro I have tested this code then uploaded here.
@@dipesh1401 OK bro i hope it would correct
Thanks man. Believe it or not Ive been learning Java for years and until now Ive never actually wrote a fully functional calculator.
well I am just commenting to support you because this video has been really helpful and i learnt more ways to use GUI in java.
I just begun with Java and made my own calculator like this. But after finishing and seeing this video, there is a lot of things I could do to definetly reduce my code size.
Thanks Bro I've learned something new today about Java especially that GUI.
Cool, this is nice.
Awesome video.
And also, I have finished creating my AI ChatBot!!
nice! Which app is it for?
bro this was really awesome ....
my sir told it but it was too confusing
but your program was clean and neat....
thank you so much .
Bro the goat. Just finished learning Java with you and am building my first project with you too
no caption king. learned a lot from you . thnaks for the quality content
best yt for coding i learned many things from you thanks you so much bro code
Thanks a million , It was really nice and perfect for a beginner like me
Small bug, when deleting characters you actually move the initial character along the string. So eventually your input will reach the other end of the textField.
To recreate this; Input any number of digits and then delete until the last one, do this over and over to move your output.
I implemented a small fix for this in my code, seen below;
if(e.getSource() == delButton){
String str = textField.getText();
textField.setText(" ");
for(int i = 0; i < str.length() - 1; i++){
String strnew = str.substring(0, str.length()-1);
textField.setText(strnew);
}
}
Implementing this substring code deletes the last character from the Char array but does not move the initial Char preventing the bug from occurring!
This was a really cool tutorial! Props to Bro Code for making this! Was perfect as I couldn't get JavaFX to work on my machine! I hope this helps.
Here's another tip: In place of "String.valueOf(double number)", you could've also used "Double.toString(double value)" to achieve much the same results. The question remains though, what is the difference between the two, if any?
Amazing video. That robotic laugh at the end got me 😂
Thanks man
You explain java better than my teacher
yo bro, love it
thanks
keep up the good work
Thank you @BroCode ☺
It was really up to the point !
Bro code,this is an amazing tutorial.Thank you Mann,you taught me alot here.
i just finish second book about java. A Beginners Guide and Complete Reference from Herbert SCHİLDT. I was looking for an example of real GUI software that wasn't beyond my knowledge and actually did something. So I could get an idea of the general programming structure. Your video help me a lot about this. Thank you.
In new in java , I found that you can type 0,3,4,5,56,6 it take me some time to fix it , also remove 5+2= 7.0 , now working on implement the keyboard . Oh , and eliminate the empty space every time you push +or / or whatever operator.
Also my comments on you is "Thanks you very much, Bro!"
Great, fantastic. It may seem a little but too advanced at the beginning, but you can try it and see:)
Polich machaa..
You are great 👏🏻👏🏻
man Thank you i really need this tutorial for my computer programming 2
awesome broo..keep rocking
Dear Bro you are simply amazing... ❤❤💐💐being sooo... generous in sharing your wealth of knowledge and you certainly deserve a very big appreciation for making me impressed to learn Java programming. God Bless You Bro...🙏🙏. I really loved it and impatient to try it ASAP..... 👌👌👍👍
Congratulations you have cracked the youtube algorithm
Your amazing Content makes me to passionate about java more...
I thought to left but ...
very helpful video. i understand for loops, if() more than before
Thanks pro
Very helpful video
Keep going
Thank you. This is my first heavy coding project😂
This was indeed Helpful brother
Thanks for the tutorial
the package come back as error what to do
Q1) How can you make the -ve button, clear btn and del btn fit ?
Q2)how to prevent someone from hitting the decimal btn twice ?
This tutorial is great, how about a simple note taking Api ?
Q2: You could implement a method which checks if a String includes a ' . ' and if so the method returns true.
Then you add that Method to the decimal button inside of an if-statement that checks if the String of the TextField includes a ' . ' which then "returns" so the button does nothing by clicking it :D
i did it like this:
this is the method i wrote( make sure its in the class body of the Calculator):
private static boolean decimalCheck(String s) {
for(int i = 0; i < s.length(); i++) {
if(s.charAt(i) == '.') {
return true;
}
}
return false;
}
and my decimalButton:
if(e.getSource() == decButton) {
if(decimalCheck(textField.getText())) {
return;
}
textField.setText(textField.getText().concat("."));
}
@@nicoimmel2642 thanks a lot man :D
I followed through this whole tutorial on Linux with text editor and terminal Javac compiling (no IDE!) and it worked flawlessly even when packaged into a jar file. I feel like I learned stuff but even if I didn’t, I at least understand how the program works and it was fun to feel like I’m coding stuff just by following along
You're the man. Good job!
in this programme , if you put par exemple 5*3*2 = it gives you 6 not 30 , and thank u for every thing else ur a lagende Bro
thanks for the video.
for the decimal point button, i added a little bit of if statement to prevent the program from adding more dots to the textfield:
if(e.getSource()==decButton)
{
String myString = textfield.getText();
if (!myString.contains(".")) { // Check if there is no dot already present
textfield.setText(textfield.getText().concat("."));
}
}
thanks for clean work it really help me !you are super good :)
Thank you so much for the perfect explanation ❤❤❤❤😭
You make it look very easy. Thanks Bro!
Thanks! (I appreciate also the 420 on the preview)
Very well explained 👍
Good day BRO! Thanks so much I can now code my simple calculator, through your tutorial.
He sounds so much like Technoblade... It's creepy.
To make sure there's only one decimal point in the number I changed the body of the if statement for the decimal button to the following:
boolean hasDecimal=false;
String string=textField.getText() ;
for(int i=0;i
side note I named my text field as "textField" with camel case which is different from how Bro named his ("textfield"); make sure to change that if you copied Bro's variable names exactly!
Thanks
Wonderful video ! This video is easy to understand and very helpful.
Wow even though your style is different, its super easy to understand and frankly, might make me do my calculator over just because It seems easier the way you did it
Amazing video I really enjoy this as this is very useful in my program
That’s was a lot of code thanks for your effort
Wonderful Tutorial
Amazing content as always man, thank you!
import javax.swing.AbstractAction;
import java.awt.AWTError;
import java.awt.AWTEvent;
My Netbins adds(the last dot continuations) to the original code.How can i fix this?.
Awesome content !
Thank you so much bro. this is really amazing
Nice content keep it up!!!🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
Excellent as always bro!
Very beautiful, Love it!
Great teaching
I just finished this and I’m sooo happy n I feel awesome😭🫂
It's a good video but I think it would be better if you use layouts to auto realignment.
Pd: Good video, sorry for my English.
hey dude what is that if you wouldn't bother explaining, (in whichever lenguage you want)
I liked very much this video and i from Buenos Aires, Argentina
Very Hard working of ur life shows
Simple and underatandable
i truly learn a lot man thanks
Thanks man that helped a lot. Nw I see how Java works.
Best calculator ever!
Awesome tutorial
Bro! These videos are awesome 👏
God of Java this guy💯💯❤️🤞
I love your channel.
so enjoyable, thanks for this Man
Thankyou for your valuable content 😍
That was great example, but what if user will click decButton more than once?
Thank you so much bro you are the only best coder
Wonderful video! This series has been really helpful in training my way of thinking too! Sometimes I pause the video and finish the line or piece of code before starting the video again so I can check it. Thank you so much for the effort!
For the delete-button Action-listener, I wrote these alternative lines btw.
if(e.getSource()==delButton) {
textField.setText(textField.getText().substring(0,(textField.getText().length() - 1)));
}
It takes the text in the textfield and replaces it with a substring that leaves out the last index. This way you don't need to create a for-loop and you can do it with one line instead! I really learned this way of thinking through practicing with your videos - so thanks a lot! :D
great example. Thanks
Very cool! Helped me alot!
Underrated!
Bro, that was awesome ❤️