From f159a0a20ab77ec3e5cdeee061fb099c0af3f948 Mon Sep 17 00:00:00 2001 From: Warren Walters Date: Wed, 8 May 2024 23:00:01 -0500 Subject: [PATCH] Syncing format of tasks --- .../default/apexdeepdive/string deep dive/length/length.md | 3 ++- .../string deep dive/toLowerCase/toLowerCase.md | 3 ++- .../string deep dive/toUpperCase/toUpperCase.md | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/force-app/main/default/apexdeepdive/string deep dive/length/length.md b/force-app/main/default/apexdeepdive/string deep dive/length/length.md index 714e1a0..27bf63e 100644 --- a/force-app/main/default/apexdeepdive/string deep dive/length/length.md +++ b/force-app/main/default/apexdeepdive/string deep dive/length/length.md @@ -27,9 +27,10 @@ String recordId = '0012A00000Bcdef'; // A 15-character Salesforce ID System.debug(recordId.length()); // Outputs: 15 ``` +--- ### Challenge: Counting 18-Character Salesforce IDs In many Salesforce applications, it is important to differentiate between 15-character and 18-character IDs, especially when integrating with systems that require the case-insensitive version. **Your task:** -Write a piece of Apex code that processes a list of Salesforce ID strings and counts how many of them are 18 characters long. You will start with a predefined list of IDs that includes both 15-character and 18-character IDs. +Write code that processes a list of Salesforce ID strings and counts how many of them are 18 characters long. You will start with a predefined list of IDs that includes both 15-character and 18-character IDs. diff --git a/force-app/main/default/apexdeepdive/string deep dive/toLowerCase/toLowerCase.md b/force-app/main/default/apexdeepdive/string deep dive/toLowerCase/toLowerCase.md index fff0401..cd101fa 100644 --- a/force-app/main/default/apexdeepdive/string deep dive/toLowerCase/toLowerCase.md +++ b/force-app/main/default/apexdeepdive/string deep dive/toLowerCase/toLowerCase.md @@ -28,9 +28,10 @@ String normalizedEmail = email.toLowerCase(); System.debug(normalizedEmail); // Outputs: 'contact@example.com' ``` +--- ### Challenge: Using `toLowerCase()` for Email Deduplication You are tasked with cleaning up a list of email addresses in a Salesforce application. Due to various input methods and user errors, the list might contain duplicate emails with different case formats. Using `toLowerCase()`, you can standardize all email addresses to lowercase to help identify and remove duplicates. **Your task:** -Write a piece of Apex code that processes a list of email strings, converts each to lowercase, and then deduplicates the list. You will start with a predefined list of emails that includes potential duplicates with varying cases. +Write code that processes a list of email strings, converts each to lowercase, and then deduplicates the list. You will start with a predefined list of emails that includes potential duplicates with varying cases. diff --git a/force-app/main/default/apexdeepdive/string deep dive/toUpperCase/toUpperCase.md b/force-app/main/default/apexdeepdive/string deep dive/toUpperCase/toUpperCase.md index 91907cb..50c18cf 100644 --- a/force-app/main/default/apexdeepdive/string deep dive/toUpperCase/toUpperCase.md +++ b/force-app/main/default/apexdeepdive/string deep dive/toUpperCase/toUpperCase.md @@ -30,9 +30,11 @@ List results = [SELECT Id, FirstName, LastName FROM Contact WHERE LastN System.debug('Matching Contacts: ' + results.size()); ``` -### Challenge: Using `toUpperCase()` +--- + +### Challenge: Using `toUpperCase()` for Data Consistency Imagine you are developing a part of a Salesforce application that handles user input for a job application form. The application responses are stored in a custom object, and one of the fields captures the job title of the applicant. To maintain consistency in the database, all job titles need to be stored in uppercase. **Your task:** -Write a piece of Apex code that accepts a string input representing the job title and converts it to uppercase. Declare a variable `jobTitle` and initialize it with the value of a tech role you would like to have. Example: "software engineer", "Salesforce Developer", "Consultant". Convert `jobTitle` to uppercase and store the result in a new variable `formattedJobTitle`. Finally, return `formattedJobTitle`. +Write code that processes a job title string entered by a user, converts it to uppercase using the `toUpperCase()` method, and stores the result in a variable. You will start with a predefined job title string and need to implement the conversion logic.