3 Replies Latest reply on May 14, 2018 6:02 AM by Mohit Aggarwal

    how to hide characters in String

    Mohit Aggarwal

      Can anyone tell the way to hide the characters in the string having n characters.

      eg. if the string has 10 character (AABBCCDDEE), then i want to show the output as (AA******EE).

      In my Input column each string having different length, But i want to show on first 2 and last 2 character and middle character should be encoded, How can I do this .

      Please help out in this.

       

      Thanks

      Mohit

        • 1. Re: how to hide characters in String
          Donna Coles

          Hi Mohit

           

          You can do this with string calculations.  I've done this in 2 steps.

          1 - create a calculated field containing the first 2 characters, then a space for each character in the middle, then the last 2 characters

          2. Then replace the spaces in that string, with *

           

          Which will give you the output below - note a 4 letter word has no * in it

           

          Of course if you don't care about the length of the masked field matching your original field, then you can just do something like

          LEFT([City],2) + '*****' + RIGHT([City],2)

           

          Donna

           

          PS - I have moved this thread into the main Forums part of the site (Forums ), where it will attract more attention. The area you've posted into, is for questions relating to how to use the forum itself.

          2 of 2 people found this helpful
          • 2. Re: how to hide characters in String
            Donna Coles

            Hi Mohit - I notice you marked my response as helpful.  Thank you.  Did it give you what you need?  If so, then please mark the answer as correct, so the thread can be closed down, and it will help others looking for similar responses.  If not, please elaborate on why it doesn't meet your needs.

             

            Thanks

            Donna

            1 of 1 people found this helpful
            • 3. Re: how to hide characters in String
              Mohit Aggarwal

              Hi Donna,

               

              The solution which you have provided is exactly same as I wanted. It's really helpful response.

              Thanks Donna.

               

              Mohit