BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
Substring Text Tutorial (Console Log) Empty5/16/2024, 8:25 am by Bully@WiiPlaza

» Bully Made It Into a BIG Video 400K Views
Substring Text Tutorial (Console Log) Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
Substring Text Tutorial (Console Log) Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
Substring Text Tutorial (Console Log) Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
Substring Text Tutorial (Console Log) Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
Substring Text Tutorial (Console Log) Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
Substring Text Tutorial (Console Log) Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
Substring Text Tutorial (Console Log) Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
Substring Text Tutorial (Console Log) Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
Substring Text Tutorial (Console Log) Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Substring Text Tutorial (Console Log)

2 posters

Go down  Message [Page 1 of 1]

Shadow@BWH

Shadow@BWH
 
 

Okay this is easy all you really need to know is place holders. I'll use a easy code. We're gonna be making the substring for "Jan" in "January" "Melbourne is" in "Melbourne is great" (note the space!)
and "burgers" in "Hamburgers". Substrings start counting at 0. So it would be like this.

Code:
0 1 2 3 4
 | | | | |
 h e l l o

Okay so we have the place holder's now were gonna move onto the actual code. You first start with console.log

step 1.
Code:
console.log

Step 2. Now add the word/words your making a substring with it would be "January" (Remember the quotations). So now the code looks like this

Code:
console.log("January"

Step 3. Adding the substring. You need to put .substring tells the console what you are doing with said text. Now the code will look like this.

Code:
console.log("January".substring

Step 4. Find the values of letter's. You want the first 3 letter's in January so the values would be 0-3. You would put that in brackets like this again telling the console the values of said word you want to see. (0,3) So now the code will look like this.

Code:
console.log("January".substring(0,3)

Step 5. Closing the code. This is really important without it it will give you a syntax error. You use ); showing that that line is done. So now the finished code is this.


Code:
console.log("January".substring(0,3));

Now it will show Jan instead of January.

Other examples for tutorial

Code:
console.log("January".substring(0,3));
console.log("Melbourne is great".substring(0,12));
console.log("Hamburgers".substring(3,10));


End result (Picture of the console log)

Substring Text Tutorial (Console Log) 20KWkdj


This is my first real tutorial on something other then making a normal command code so all feed back is good. Tell me where I can improve if needed. Being honest I'm not sure how good I did.


_________________
Substring Text Tutorial (Console Log) BAjMdNS

Bully@WiiPlaza

Bully@WiiPlaza
 
 

You skid, know the language you're coding! Again, it's called "Javascript". There's a big difference between Java and Javascript.

Read:
https://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java

Other than that, alright tutorial. You might want to add a website where you can execute Javascript online like here:
http://jsfiddle.net/

As a side-note, the dumbass Nero also wouldn't understand that I'm not coding "Javascript" but "Java" for my programs. Supposedly the "most basic" language but he can't code it. To be exact, he can't code any language xD



Last edited by Bully@WiiPlaza on 12/2/2014, 4:30 am; edited 1 time in total


_________________
Substring Text Tutorial (Console Log) YBjg74I

Shadow@BWH

Shadow@BWH
 
 

Lol Okay point taken. I'll fix the title I keep forgetting the damn JavaScript name xD.


_________________
Substring Text Tutorial (Console Log) BAjMdNS

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum