All Questions
Tagged with common-lisp strings
8 questions
2
votes
2
answers
199
views
Generating a list (or a string) with random elements
During implementation and testing of different small hobby projects I often reach the point where I need (at least I like it more) some random data beyond the usual foo-bar strings or lists. Random ...
3
votes
2
answers
904
views
Reading lines of integers into a list of lists
I have a text file containing integers in different lines which I want to read into a list of lists.
So
01
11 14
45 50 09
should become
...
3
votes
1
answer
58
views
Determine indentation of a line of code
The following function determines the amount of indentation of a string. It returns two values. The first is an effective indentation where tabs are expanded such that their end aligns with 4 spaces ...
6
votes
1
answer
94
views
Finding capitalized characters and printing their position & ASCII value
I was trying to find out if a string contained a capitalized letter and if it did I wanted to know the position of the character and its ASCII code. I might have refactored a little to much.
Given an ...
4
votes
2
answers
894
views
Creating a repetitive string in Common Lisp
I needed to have a Lisp function that could produce a string of a certain length, created by repeated concatenations of a another string given as argument (so for example by giving 10 and "abc" I ...
2
votes
1
answer
846
views
LISP - Modify string
I have to write a program that changes a string's vowels, consonants and other symbols into C, V respectively 0. I've done this but I wonder if there is a more efficient and elegant way to do it. ...
2
votes
1
answer
345
views
Abstract the (duplicate?) behavior between "sort" and "replace"
I have written these two functions that have a similar process. The first is meant to "split" a string on a given character and the second is meant to "replace-all" instances of a character in a ...
4
votes
2
answers
3k
views
Print an integer and its digits reversed
This Common Lisp program is an exercise to print an integer and its digits reversed to the screen:
...