Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 05-09-2017, 11:31 AM
robert robert is offline
Senior Member
 
Join Date: Sep 2014
Posts: 379
Default Divide String

I have a string

1fkh5872lkjfdhgkd97347643msdhljfdsgaf


How can I divide it in two equal parts
  #2  
Old 05-09-2017, 12:36 PM
bobgambler bobgambler is offline
Junior Member
 
Join Date: Apr 2017
Posts: 2
Default

Procedure DivideString(pString : String);
Var vPart1, vPart2 : String;
Begin
vPart1 := Copy(pString, 1, (Length(pString) div 2));
vPart2 := Copy(pString, ((Length(pString) div 2) + 1), Length(pString));
End;
  #3  
Old 05-09-2017, 03:01 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,218
Default

If you can devide a string with an Odd length in 2 equal parts you're a genious!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 03:47 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.