Question: So my goal is to have Jenkins send an email to developer who was involved with any code changes in the repo in Mercurial. I have set up my hooks on Mercurial and now whenever I do any sort of changes on the repo a build executes on Jenkins which builds without any issue. The problem now is its only sending it to the email that I have configured in Jenkins and not the email of the developer who made the changes. On Mercurial I made sure to make the user the email I primarily use. I was pretty sure the code below would be able to access the email of the developer who made the changes:

```
pipeline {
   agent any

   stages {
      stage('Hello') {
         steps {
            echo 'Hello World'
         }
      }
   }

   post {
    always {
    emailext body: 'A Test EMail', recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']], subject: 'Test'
    }
}
}

```

Given that it hasnt I am suspecting that Jenkins is not aware of the email of the developer who made the changes. How do I tell Jenkins about the email of the developer who made the changes? I also made sure to install all of the email plugins for Jenkins btw but still no luck.

Answer: 
Your program will work only for an input consisting of one character e.g. if you input `a`, it will print `@` and if you input `e`, it will print `$` and so on (if you add other vowels too in your program). It is because you are comparing (and replacing) the whole input string rather than comparing (and replacing) the character(s) of the input string. 

There are many ways in which you can do it. A couple of them are as follows:

1. Get an array of characters out of the input string and then iterate the array to process the printing as per your requirement e.g.

```
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the string to be converted: ");
        String convert = input.nextLine();
        for (char ch : convert.toCharArray()) {
            switch (ch) {
            case 'a':
                System.out.print('@');
                break;
            case 'e':
                System.out.print('$');
                break;
            case 'i':
                System.out.print('^');
                break;
            case 'o':
                System.out.print('*');
                break;
            case 'u':
                System.out.print('&');
                break;
            default:
                System.out.print(ch);
            }
        }
    }
}

```

**A sample run**:

```
Enter the string to be converted: coronavirus
c*r*n@v^r&s

```
2. Replace the characters as per your requirements using [String::replace](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html#replace(char,char)) e.g.

```
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the string to be converted: ");
        String convert = input.nextLine();
        convert = convert.replace('a', '@').replace('e', '$').replace('i', '^').replace('o', '*').replace('u', '&');
        System.out.println(convert);
    }
}

```

**A sample run:**

```
Enter the string to be converted: coronavirus
c*r*n@v^r&s

```
You have to add this instead of your if sentences:

```
for (int i = 0; i < convert.length(); i++ { //This loop will repeat the same times that the String's lenght
    switch (convert.charAt(i) {
        case 'a': System.out.print("@");
            break;
        case 'e': System.out.print("$");
            break;
        case 'i': System.out.print("&");
            break;
        case 'o': System.out.print("#"); // Here you put the letter to replace.
            break;
        default: // This code will execute if there's a option you didn't put on the cases
    }
}

```