none
string manipulations in small basic

Answers

  • Small Basic is unusual that is does treat numbers as strings (one type) as far as the user is concerned, internally it checks if the data can be treated as a number or must remain a string.

    So Math.Cos("F") won't work

    "1"+"2.3" is treated differently to "1"+"2.x" etc.

    Monday, March 04, 2013 11:55 AM
    Moderator

All replies

  • A string is a computing term for a set of characters stored in a variable, stuff like a word or sentence.  In Small BAsic this is anything that is not a number really and inside double quotes.

    Examples:

    "Hello World"

    "Fred"

    String manipulation is just modifying, combining, finding substrings etc.


    Monday, March 04, 2013 10:37 AM
    Moderator
  • Thanks

    Are number variables considered to be strings as well in sb.

    e.g. i turned some numerical values stored in an array into an Appended text string then manipulated it.

    see: http://smallbasic.com/program/?FXJ326  <The Random Password Generator>

    Which btw was my solution to Febs Text Challenge. I just finished it. What a great challenge.

    Monday, March 04, 2013 11:11 AM
    Answerer
  • Curriculum Challenge 1.2

    Hi litDev

    I like your Challenge for beginners in the March Challenge. It's quite challenging for that part of the curriculum especially setting the window in the centre of the screen.

    If you decide to do it again next month do you think would be better to post it as the first challenge? Then the harder stuff below it.

    Monday, March 04, 2013 11:55 AM
    Answerer
  • Small Basic is unusual that is does treat numbers as strings (one type) as far as the user is concerned, internally it checks if the data can be treated as a number or must remain a string.

    So Math.Cos("F") won't work

    "1"+"2.3" is treated differently to "1"+"2.x" etc.

    Monday, March 04, 2013 11:55 AM
    Moderator
  • Sure
    Monday, March 04, 2013 12:16 PM
    Moderator