The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing some letters of a string
Author Message
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #5
RE: Removing some letters of a string
I would do the following:

generate a random number between 0 and string length-1.

get a substring of the random number. Store that somewhere.

then get a random number between last random number + 1 and string length-1.

get a substring of random number + 1 -> new random. and concatenante that to the last stored substring.

repeat that step again and you will have joined 3 substrings, which should have cut off 1 character following the value of the random number that was picked.


if that makes sense Sad

ULTIMA ONE
The modern, sphere powered Ultima Online server
(This post was last modified: 02-27-2013 03:39 AM by Ultima One.)
02-27-2013 03:39 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Removing some letters of a string - Ultima One - 02-27-2013 03:39 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)