Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C#, Split a string in half

  • 19-06-2012 9:11pm
    #1
    Registered Users, Registered Users 2 Posts: 7,516 ✭✭✭


    I have a string which can be of any length and will have no unique characters.

    I want to split this in half and store the sections in two separate variables.

    Any ideas?


Comments

  • Registered Users, Registered Users 2 Posts: 2,054 ✭✭✭Colonel Panic


    I'm sure you could work something out with string.Length and string.SubString...


  • Registered Users, Registered Users 2 Posts: 7,516 ✭✭✭BrokenArrows


    I'm sure you could work something out with string.Length and string.SubString...


    Bingo. Thanks.


  • Registered Users, Registered Users 2 Posts: 903 ✭✭✭moycullen14


    I have a string which can be of any length and will have no unique characters.

    I want to split this in half and store the sections in two separate variables.

    Any ideas?

    string /= 2; :)


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Wow, just wow. You actually asked how to do this instead of trying to work it out.


This discussion has been closed.
Advertisement