[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Format data in gridview column

Hi Expert,

I have a gridview column Student number is 0003439989, how I can format them use '99-9999-9999' format?

Thanks in advance.
0
dshi15
Asked:
dshi15
  • 3
1 Solution
 
Priya SudharsanCommented:
You can use String.Insert() method to achieve.

StudentNumber = '0003439989';
StudentNumber = StudentNumber.Insert(2,'-');
StudentNumber = StudentNumber.Insert(8,'-');

Open in new window

0
 
dshi15Author Commented:
I tested and it doesn't work and I need declare too string to accomplish it.
0
 
dshi15Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for dshi15's comment #a40307592

for the following reason:

I tested and it doesn't work and I need declare two strings to accomplish it.
0
 
dshi15Author Commented:
I tested and it doesn't work and I need declare too string to accomplish it.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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