| |

VerySource

 Forgot password?
 Register
Search
View: 638|Reply: 3

C # how to get the string at the specified position

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-21 10:40:02
| Show all posts |Read mode
For example: 123456789, how can I get 3456? It is 3-6 digits of the string.
Reply

Use magic Report

0

Threads

52

Posts

34.00

Credits

Newbie

Rank: 1

Credits
34.00

 China

Post time: 2020-1-30 18:36:01
| Show all posts
string s = "123456";
s = s.SubString (2,4);
Reply

Use magic Report

0

Threads

16

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-1-30 19:18:01
| Show all posts
string str = OldString.SubString (int start, int length);

Truncate a string of length from the start position
Yours is: SubString (2,4);
Reply

Use magic Report

0

Threads

27

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-1-30 19:36:01
| Show all posts
The solution is upstairs.
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