| |

VerySource

 Forgot password?
 Register
Search
View: 777|Reply: 6

Truncate by string digits, how do I do that?

[Copy link]

5

Threads

16

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 United States

Post time: 2020-1-15 13:40:02
| Show all posts |Read mode
There are the following fields:
04002005000807102980

The results after interception are as follows:
string a (1) = "0"
string a (2) = "4002"
string a (3) = "0050"
string a (4) = "0"
string a (5) = "0807"
string a (6) = "1"
string a (7) = "0"
string a (8) = "2980"
Reply

Use magic Report

0

Threads

60

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-1-18 20:18:01
| Show all posts
Talk about what rules, how to divide without rules
Reply

Use magic Report

5

Threads

16

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-1-19 17:27:01
| Show all posts
a (1) is the first character
a (2) 2nd to 5th characters
a (3) 6th to 9th characters
a (4) 10th character
a (5) 11th to 14th characters
a (6) 15th character
a (7) 16th character
a (8) 17th to 20th characters
Reply

Use magic Report

5

Threads

16

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-1-24 21:27:01
| Show all posts
Please master help
Reply

Use magic Report

0

Threads

10

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-26 13:09:01
| Show all posts
Dim sa As String = "04002005000807102980"
        Dim oArray As New List (Of String) 'Define the array
        oArray.Add (sa.Substring (0, 1))
        oArray.Add (sa.Substring (1, 4))
        oArray.Add (sa.Substring (5, 4))
        oArray.Add (sa.Substring (9, 1))
        oArray.Add (sa.Substring (10, 4))
        oArray.Add (sa.Substring (14, 1))
        oArray.Add (sa.Substring (15, 1))
        oArray.Add (sa.Substring (16, 4))
Reply

Use magic Report

0

Threads

10

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-26 13:54:01
| Show all posts
There is no regularity, only this!
If it is regular, it will be more logical to do it!
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-26 21:27:02
| Show all posts
Dim MyString As String = "04002005000807102980"
        Dim A1 As String = Mid (MyString, 1, 1)
        Dim A2 As String = Mid (MyString, 2, 4)
        Dim A3 As String = Mid (MyString, 6, 4)
        Dim A4 As String = Mid (MyString, 10, 1)
        Dim A5 As String = Mid (MyString, 11, 4)
        Dim A6 As String = Mid (MyString, 15, 1)
        Dim A7 As String = Mid (MyString, 16, 1)
        Dim A8 As String = Mid (MyString, 17, 4)
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list