Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1083
  • Last Modified:

c# string hide text

Hi,

I have the following string

string sDetailsinTitle = "ID: " + sID + "Client Name: " + sClientName.PadRight(30) + "Mobile: " + sMobile + Environment.NewLine ;

Open in new window


Is there a way I can hide the ID from being displayed just like i have Environment.NewLine  which gives a new line break

Please help

thanks

R8VI
0
R8VI
Asked:
R8VI
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
inside a plain string, you cannot "hide" something.
as you posted this in asp.net also, you could put that part into a DIV that is hidden

for example:
string sDetailsinTitle = "<div name=\"ID\" style=\"display:none; visibility: hidden; \"> </div>" + sID + "</div>Client Name: " + sClientName.PadRight(30) + "Mobile: " + sMobile + Environment.NewLine ;

Open in new window

0
 
Fernando SotoRetiredCommented:
Is this a Windows Form or Web project? In either case it will most likely be better to crate a second string without the ID in it.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now