473,395 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

wheel algo

how we split a string like


if string is even (abcdef) then print afbecd
or string is odd (abcde) then print aebde@
Feb 27 '17 #1
2 840
I assume you meant "aebdc@" in your odd example. If so, then you can repeatedly remove the first and last characters from the input string, adding them to the output string in that order, until the length of the remaining string is less than 2.

Then, if there's a character remaining at the end (length is 1, not 0) then append it to the end of your output string, followed by a '@'.

It's been 15+ years since I've done anything at all in VB6, and I don't remember the syntax well enough to offer a working code snippet, but that idea will work with any language that has strings with concatenation and a substring function or method.
Feb 27 '17 #2
I presume your odd/even refers to the length of the string.
If so, this will work.

Expand|Select|Wrap|Line Numbers
  1. if len(yourstring)\2 = 0 then       'even number
  2.     print "abcdef"
  3. else
  4.     print "aebde@
  5. end if
  6.  
Feb 27 '17 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Christian Meisinger | last post by:
hi. has anyone tryed to check .htpasswd passwords with php? everythink works fine as long as they are encrypted with the default CRYPT mode of apaches htpasswd. crypt($pass, $htpass) ===...
6
by: AccessWhiz | last post by:
I have been trying desperately for the past few days to figure out why the MouseWheel solution that I retrieved from the Lebans website won't work. The access database included with the solution...
5
by: Ima Lostsoul | last post by:
Anyone have a simple way to disbale the wheel on a wheel mouse in Access Apps? I have tried the Lebans code and it does not work for my application.
3
by: Devonish | last post by:
I have a form designed as a Continuous form which displays one record per line. Taking account of the header and footer and the size of the screen, I can display 30 records at a time. I can see...
1
by: jv | last post by:
I have quite a few of continuous form and subform where I do allow scroll bars. I run into problems with the mouse wheel whenever the data on the form does not take up the whole page. In this...
4
by: ML | last post by:
I am trying to use the mouse wheel event on a numeric input box to allow the use to scroll to inc/dec the value by 1. The issue I am having is that the delta value returned seems to be off. From...
7
by: Martijn Mulder | last post by:
When the mouse is over a picture, the user can grow or shrink it by rolling the central mouse wheel. What behavior is typical when the user rolls the wheel away. Will the picture grow or shrink...
3
by: empiresolutions | last post by:
I am building a app that creates quizzes. This is how it goes - - Create Quiz - Provide up to 10 different types of Quiz Results - Give up to 50 Questions - Each Question has up to 10 possible...
3
by: killbill123 | last post by:
Hi, I want to count the mouse wheel rotations in javascript. I searched on google and only found that how to track delta -1 and +1 base on the up mouse wheel and down mouse wheel. I want how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.