Results 1 to 2 of 2

Thread: String Manipulation

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2014
    Location
    Northampton, UK
    Posts
    59

    String Manipulation

    Hi all I have a string

    1234567789485116 and what I would like to do is to blank out every number apart from the last 5 so it would look like this **********85116 how would i do this?

    Andy

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: String Manipulation

    You can use String.Length to determine how long your String is. You can then use String.Substring to get the last 5 characters based on that length. You can also then create a new String of that same length full of asterisks. Finally, just concatenate those two substrings.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width