5 Replies - 3544 Views - Last Post: 30 July 2008 - 12:14 AM Rate Topic: -----

#1 itayzoro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 29-July 08

String trim problem

Post icon  Posted 29 July 2008 - 11:09 PM

I got this string : "12{TAB}30/07/2008 11:53:18{TAB}4"

what i need is to turn it into this one : ""12{TAB}20080730115318{TAB}4"
lets say i will find a way to get rid from the "/" and the ":" but how i turn the year month and day?
Is This A Good Question/Topic? 0
  • +

Replies To: String trim problem

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2216
  • View blog
  • Posts: 9,352
  • Joined: 29-May 08

Re: String trim problem

Posted 29 July 2008 - 11:34 PM

View Postitayzoro, on 30 Jul, 2008 - 07:09 AM, said:

I got this string : "12{TAB}30/07/2008 11:53:18{TAB}4"

what i need is to turn it into this one : ""12{TAB}20080730115318{TAB}4"
lets say i will find a way to get rid from the "/" and the ":" but how i turn the year month and day?

        Dim q As String = "12{TAB}30/07/2008 11:53:18{TAB}4"
        q = q.Replace("/", "")
        q = q.Replace(":", "")
        q = q.Substring(0, 7) & q.Substring(11, 4) & q.Substring(9, 2) & q.Substring(7, 2) & q.Substring(16)


This post has been edited by AdamSpeight2008: 29 July 2008 - 11:59 PM

Was This Post Helpful? 0
  • +
  • -

#3 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 109
  • View blog
  • Posts: 1,530
  • Joined: 25-January 07

Re: String trim problem

Posted 29 July 2008 - 11:37 PM

--Deleted--

as solution is already given by AdamSpeight2008.

This post has been edited by AmitTheInfinity: 29 July 2008 - 11:40 PM

Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2216
  • View blog
  • Posts: 9,352
  • Joined: 29-May 08

Re: String trim problem

Posted 29 July 2008 - 11:58 PM

View PostAmitTheInfinity, on 30 Jul, 2008 - 07:37 AM, said:

--Deleted--

as solution is already given by AdamSpeight2008.

There many solutions.
Heres another.
Dim q As String = "12{TAB}30/07/2008 11:53:18{TAB}4"
q = q.Substring(0, 7) & q.Substring(13, 4) & q.Substring(10, 2) & q.Substring(7, 2) & q.Substring(18)


Was This Post Helpful? 0
  • +
  • -

#5 itayzoro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 29-July 08

Re: String trim problem

Posted 30 July 2008 - 12:05 AM

View PostAdamSpeight2008, on 29 Jul, 2008 - 11:34 PM, said:

View Postitayzoro, on 30 Jul, 2008 - 07:09 AM, said:

I got this string : "12{TAB}30/07/2008 11:53:18{TAB}4"

what i need is to turn it into this one : ""12{TAB}20080730115318{TAB}4"
lets say i will find a way to get rid from the "/" and the ":" but how i turn the year month and day?

        Dim q As String = "12{TAB}30/07/2008 11:53:18{TAB}4"
        q = q.Replace("/", "")
        q = q.Replace(":", "")
        q = q.Substring(0, 7) & q.Substring(11, 4) & q.Substring(9, 2) & q.Substring(7, 2) & q.Substring(16)



First 10nx it was very helpful-the way todo this !!!

But i need "12{TAB KEY}30/07/2008 11:53:18{TAB KEY}4"
{TAB KEY} = vbtab
so now i have to insert 2 {TAB KEY} after 12 , and before 4
can u direct me to the right way to do this?
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2216
  • View blog
  • Posts: 9,352
  • Joined: 29-May 08

Re: String trim problem

Posted 30 July 2008 - 12:14 AM

View Postitayzoro, on 30 Jul, 2008 - 08:05 AM, said:

First 10nx it was very helpful-the way todo this !!!

But i need "12{TAB KEY}30/07/2008 11:53:18{TAB KEY}4"
{TAB KEY} = vbtab
so now i have to insert 2 {TAB KEY} after 12 , and before 4
can u direct me to the right way to do this?


There enough information and knowledge available in this post. To figure it out
Clue
CChar(Vbtab)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1