I have this jButton that transfers the text from one text area to another but now I need to make it strip the sentence but I don't know how to call on the strip string. Thanks in advance!
Here's the code:
package encryptor;
import java.io.File;
import javax.swing.JFileChooser;
import java.util.Scanner;
import java.awt.event.ActionListener;
public class Encryptor extends javax.swing.JFrame
{
public Encryptor()
{
initComponents();
setLocationRelativeTo(null);
}
private void jButtonEncryptActionPerformed(java.awt.event.ActionEvent evt)
{
jTextAreaTarget.setText(jTextAreaSource.getText());
jButtonEncrypt.addActionListener(new ActionListener());
}
public static String strip(String s)
{
String target = "";
char[] a = s.toUpperCase().toCharArray();
for (int i = 0; i < a.length; i++)
{
char c = a[i];
if (c >= 'A' && c <= 'Z')
{
target += c;
}
}
return target;
}