Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StringTake with a string sequence. #1297

Merged
merged 2 commits into from
Apr 22, 2021
Merged

Conversation

rocky
Copy link
Member

@rocky rocky commented Apr 20, 2021

@mmatera the thing I don't know about here is what happens when StringTake is given a bad parameter of some form.

@rocky rocky requested a review from mmatera April 20, 2021 21:27
@mmatera
Copy link
Contributor

mmatera commented Apr 20, 2021

Here a couple of examples

In[1]:= StringTake[{2,4},2]

StringTake::strse: 
   String or list of strings expected at position 1 in StringTake[{2, 4}, 2].
 
Out[1]= StringTake[{2,4},2]

In[2]:= StringTake["kkkl",Graphics[{}]] 

StringTake::mseqs: 
   Sequence specification (+n, -n, {+n}, {-n}, {m, n}, or {m, n, s}) or a list
     of sequence specifications expected at position 2 in 
    StringTake[kkkl, -Graphics-].

Out[2]= StringTake[kkkl, Graphics[{}]]

In[3]:= StringTake["als", 10] 

StringTake::take: Cannot take positions 1 through 10 in "als".

Out[3]= StringTake[als, 10]

@rocky
Copy link
Member Author

rocky commented Apr 21, 2021

StringTake["als", 10]

@mmatera thanks for the information. I think things are synchronized now to as close as we can get.

@rocky rocky force-pushed the StringTake-sequence-arg branch 3 times, most recently from 1fde55d to bd1d821 Compare April 21, 2021 03:01
Thanks mmatera!
Copy link
Contributor

@mmatera mmatera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rocky rocky merged commit 3d32230 into master Apr 22, 2021
@rocky rocky deleted the StringTake-sequence-arg branch April 22, 2021 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants