Poll: Is this question well formatted?
Yes
No
[Show Results]
 
Post Reply 
Text wrap mode
06-28-2021, 11:40 AM
Post: #4
RE: Text wrap mode
Unlike Python, CAS string is 1-based:

CAS> wrap(s,n) := transpose(makelist(k->s[k:k+n],1,len(s)+1,n))
CAS> s := "654765675865784866587657655555465"
CAS> wrap(s, 10)

\(\left(\begin{array}{c}
\mathrm{6547656758} \\
\mathrm{6578486658} \\
\mathrm{7657655555} \\
\mathrm{465}
\end{array}\right) \)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Text wrap mode - DuckEgg - 06-25-2021, 09:51 AM
RE: Text wrap mode - matalog - 06-27-2021, 11:13 PM
RE: Text wrap mode - DuckEgg - 06-28-2021, 01:57 AM
RE: Text wrap mode - Albert Chan - 06-28-2021 11:40 AM
RE: Text wrap mode - Stevetuc - 06-29-2021, 12:51 PM
RE: Text wrap mode - roadrunner - 06-28-2021, 06:40 PM
RE: Text wrap mode - roadrunner - 06-29-2021, 05:36 PM



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