backspstr

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Text/Strs/Chars/Links
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-07, Last change: 2025-09-14

returns a backspace character string to remove the given string



See Also: fprintfvec

Example Illustration

 missing image of backspstr(str)

Syntax

bs=backspstr(str)

Input Parameter

str: string to remove

Output Parameter

bs: backspaces to remove string

Examples


backspstr('this is a test')




Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, backspstr, is designed to generate a string of backspace characters that can be used to remove a given input string from a display or console output.

Input Parameters

Output Results

Algorithm Steps

  1. The function first checks if the input string str contains characters within the ASCII range 32 to 127. This step is commented out in the code, so it does not affect the current functionality.
  2. The function then uses the repmat function to create a string of backspace characters. The backspace character is represented by the ASCII value 8. The number of backspace characters generated is equal to the number of characters in the input string str.
  3. If the function is called without an output argument, it will print the input string, pause for 0.5 seconds, and then print the backspace string to effectively remove the input string from the display.

Example Usage

Calling backspstr('this is a test') will generate a string of backspace characters that can be used to remove the text "this is a test" from a console or display.

Algorithm explaination created using ChatGPT on 2025-08-18 22:24. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21